[jira] [Created] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
---------------------------------------------------------------------------------------------------

                 Key: OFBIZ-4349
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: SVN trunk
            Reporter: Leon


in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erwan de FERRIERES updated OFBIZ-4349:
--------------------------------------

    Attachment: OFBIZ-4349.patch

The previous commit was to correct the problem occuring when realEntity pkFieldName is different from viewEntity pkColName, but it's only working with simple view and it breaks retrieving i18n for view with multiple entity and pkColName == pkFieldName.
So this new patch solves the two situations. Now the method :
       use pkField of realEntity
and retrieve for each pkField the correct colAlias

I'm waiting for your comments.

Cheers,

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>         Attachments: OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070913#comment-13070913 ]

Leon commented on OFBIZ-4349:
-----------------------------

Erwan, I think you consider too much and make things a little complex. The method get(ModelEntity modelEntity, ModelEntity modelEntityToUse, String name, String resource, Locale locale) is private and only invoked by method get(String name, String resource, Locale locale). In the latter one, it tries to get i18n value from entity firstly (no matter it's view entity or real), if failed, then it will try to get i18n value from member entity again if it's a view entity. So you do not need to repleat the same implementation in get(ModelEntity modelEntity, ModelEntity modelEntityToUse, String name, String resource, Locale locale). I extract some code from get(String name, String resource, Locale locale) method and paste them below. You will find that it's very similar as that in your patch.

{noformat}
        ModelEntity modelEntityToUse = this.getModelEntity();
        Object resourceValue = get(this.getModelEntity(), modelEntityToUse, name, resource, locale);
        if (resourceValue == null) {
          if (modelEntityToUse instanceof ModelViewEntity) {
              //  now try to retrieve with the field heading from the real entity linked to the view
              ModelViewEntity modelViewEntity = (ModelViewEntity) modelEntityToUse;
              Iterator<ModelAlias> it = modelViewEntity.getAliasesIterator();
              while (it.hasNext()) {
                  ModelAlias modelAlias = it.next();
                  if (modelAlias.getName().equalsIgnoreCase(name)) {
                      modelEntityToUse = modelViewEntity.getMemberModelEntity(modelAlias.getEntityAlias());
                      name = modelAlias.getField();
                      break;
                  }
              }
              resourceValue = get(this.getModelEntity(), modelEntityToUse, name, resource, locale);
              if (resourceValue == null) {
                  return fieldValue;
              } else {
                  return resourceValue;
              }
          } else {
              return fieldValue;
          }
        } else {
            return resourceValue;
        }
{noformat}


> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>         Attachments: OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112391#comment-13112391 ]

Olivier Heintz commented on OFBIZ-4349:
---------------------------------------

Leon,

Maybe, my explanations was not clear, I try to be more clear. The problem I want to solve was not about field name the method search to read the international content, but on the pk (name) to retrieve the correct record.

In the method you give, search is doing to check if there is a alias for field name to retrieve.
In my patch, I check to have correct pkName.

As exemple, in projectmgr component, there are view name Project.... with pk named projectId not workEffortId  and workeffortName should be renamed projectName.
With initiale code (before my first correction), it will be a call to get method with name=workEffortName, but search in properties  will fail because this.get("workEffortId") return a error "workEffortId is not a field for....".

I used this patch for 2 months and I can say that he solve really the problem.

Cheers.

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>         Attachments: OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112670#comment-13112670 ]

Leon commented on OFBIZ-4349:
-----------------------------

I understand. In the code I paste, it tries to get the real field name from alias. But in your patch, it's reversed to find the alias name for real field. Thanks for your explain and contribution. I think it's ok to apply your patch.

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>         Attachments: OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Assigned] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erwan de FERRIERES reassigned OFBIZ-4349:
-----------------------------------------

    Assignee: Erwan de FERRIERES

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>            Assignee: Erwan de FERRIERES
>         Attachments: OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erwan de FERRIERES closed OFBIZ-4349.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk

done at 1174308

Thanks Olivier and Leon

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>            Assignee: Erwan de FERRIERES
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Reopened] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon reopened OFBIZ-4349:
-------------------------


there's a bug in recent commits. see "https://demo-trunk.ofbiz.apache.org/partymgr/control/NewCustomer": if you select country as USA, then the state name in state combobox are all "United States".


               

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>            Assignee: Erwan de FERRIERES
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon updated OFBIZ-4349:
------------------------

    Attachment: OFBIZ-4349.patch

patch to resolve issue mentioned just above: to get the field alias from same member view entity.
and, correct some typos.
               

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>            Assignee: Erwan de FERRIERES
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4349.patch, OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (OFBIZ-4349) commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sascha Rodekamp closed OFBIZ-4349.
----------------------------------

    Resolution: Fixed
      Assignee: Sascha Rodekamp  (was: Erwan de FERRIERES)

Thanks Le for the fix it is committed in trunk @Rev1179943
               

> commit r1077940 breaks the function to retrieve i18n translation from real entity underlying a view
> ---------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4349
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4349
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon
>            Assignee: Sascha Rodekamp
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4349.patch, OFBIZ-4349.patch
>
>
> in r1077940 changeset ([https://fisheye6.atlassian.com/changelog/ofbiz?cs=1077940]), it gets the pk fiels from view entity instead of previous real entity. I cannot understand what author erwan commented: "When using a view and fields with different names than in the original entity, the model was taking the original names so this could lead to warnings". The consequence of this commit is it cannot retrieve i18n translation from real entity now because the pks of view entity is usually different than that of its base tables.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira