In my opinion it would be straight forward, if the entity import would treat fields that are mentioned in entity XML files as fields that should be updated always, as the GenericDAO does. The current logic ignores fields, if there is only an empty string as value.
The enhancement brought by the solution of OFBIZ-4949 makes it possible to generally configure an entity-engine-xml file to be interpreted as replacement, so that all NOT mentioned fields are set to NULL instead of leaving the old value while updating the entity.
Nevertheless I think, that the default (update) behavior, the one with fine grained control over which fields are touched, should also give the possibility to set field values to NULL by including them in the XML.
The solution with the lowest impact on existing XML files and the most natural meaning should be to interpret empty string values in the XML as NULL, as it is today. The only difference would be, that they are not longer ignored but set as NULL values in the database. The only drawback I see is, that you're still not able to set "empty string" values as concrete values to the database (no loss of function, because you can't do it today, too).
As far as I can see, there should be no conflict with current existing data files. There are some where for example a parentTypeId is contained with empty string as value. Interpreting it as NULL and setting in database is exactly what is meant by such a definition.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1706316 13f79535-47bb-0310-9956-ffa450edef68
categoryContentWrapper.DESCRIPTION;
before committing r1705405. This fixes them
Thanks also for Deepak's report about it, it was obvious when you loaded the ecommerce apps
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1705412 13f79535-47bb-0310-9956-ffa450edef68
Note that in supported releases it's hard to exploit, it's a Stored XSS https://www.owasp.org/index.php/Types_of_Cross-Site_Scripting which means you need 1st to somehow inject exploiting code in the DB.
This fixes it by changing the ContentWrapper interface
from
public interface ContentWrapper {
public StringUtil.StringWrapper get(String contentTypeId);
}
to
public interface ContentWrapper {
public StringUtil.StringWrapper get(String contentTypeId, String encoderType) {
}
And changing the Category, Party, Product, ProductPromo and WorkEffort ContentWrapperS accordingly. This means to use 2 types of encoderTypes: "html" and "url".
The "html" encoderType will be used for all ProductContentTypes but those who contain URL in their ContentTypeIdS (actually end with, "_URL") which will use "url" encoderType.
It concerns not only the get() method but also methods like getPartyContentAsText(), getProductContentAsText(), etc.
It seems a big change but it's straightforward. It's normally complete.
There are some (unrelated) tabs replaced by spaces here and there, and few trailing spaces removed but nothing big
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1705329 13f79535-47bb-0310-9956-ffa450edef68
In all releases the code in ProductSummary.groovy tries to collect prices for variants. Doing so it use NumberFormat.format() to transform base price into string that is part of an embed JS snippet. In case purchase order this price is rather empty. Using null with formatting method cause error. You may see this error in the trunk if you starts PO and and try Browser Categories->Widgets->Small Widgets. This price should appear if you select Select Units of Measure for WG-1111 but currently this does not work.
I'm not sure these prices make sense for purchase orders but my goal was just fix ugly error message. Solution display N/A if price is not available.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1705004 13f79535-47bb-0310-9956-ffa450edef68
Removes unused methods (not in Java code, FTL templates and Groovy scripts) in GenericValue and EntityUtil classes + misc related comments or logs
Adds log warning to spot possible use cases in templates and scripts of getRelated() and getRelatedOne() methods
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704769 13f79535-47bb-0310-9956-ffa450edef68
When an order is entered via the ecommerce component for a GZ-1006-5 an error is shown in the order items section
jleroux: actually, as Vyom Jain suggested "This is happening due to changes OFBIZ-6276. Either r1704108 should be reverted or additional patches be provided to avoid this reported issue (which is only one of them). Removing deprecated delegator methods require thorough testing as many as used in scripts and templates." I checked there was only 3 such changes for findByAnd and no others but getRelated where called in *.ftl and *.groovy. This completes the findByAnd case I will create a new Jira for the rest (did not check already, 238 cases!)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704478 13f79535-47bb-0310-9956-ffa450edef68
jleroux: I did the same in order controller (was only in ecommerce) even if only a commented out example was used there
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704227 13f79535-47bb-0310-9956-ffa450edef68
There are unnecessarily eclipse internal Groovy Library classpath container referenced in the .classpath file. This may lead to conflicts with the OFBiz "original" groovy libs contained in the framework and produces errors while running OFBiz within eclipse.
{{<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>}}
{{<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>}}
I'll provide a patch for this.
jleroux: I must say I never clearly understood nor researched why we should hace those :D
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704146 13f79535-47bb-0310-9956-ffa450edef68
Instead of former YUGOSLAVIA there should be SERBIA.
Also CountryTeleCode and CountryCapital is missing for MONTENEGRO.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704140 13f79535-47bb-0310-9956-ffa450edef68
NotoSans is the defaultFontFamily for FOP and the extra stylings and the font-weight="bold" are not rendered correctly unless changed to another font family
jleroux: this needs clarification, I will ask Christian
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704130 13f79535-47bb-0310-9956-ffa450edef68
As reported Adam:
It appears that the storeAll() variants are being refactor; basically, the useCache parameter is being removed. However, this has caused the entity engine to have deprecation with itself.
Gareth suggested:
What about new method that allows passing in an options object
storeAll(List<GenericValue> values, StoreOptions options) ?
You can deprecate the old methods without changes
Moving forward, you would just need to add new values to the StoreOptions class rather than adding new parameters to the existing one
I am not sure about the name StoreOptions though, EntityOptions ?
Martin contributed the implementation and suggested EntityStoreOptions for the new class name.
Ha created a patch which removes the use of deprecated API and the deprecated API itself from Delegator and GenericDelegator.
Introduced the EntityStoreOptions class as mentioned in a comment before to substitute the createDummyFks parameter of storeAll method to avoid ambiguous API after removing the deprecated doCacheClear parameter.
The decryptFieldValue method, just defined deprecated by Jacopo is left there as deprecated. Only the "old" deprecated methods where removed.
Gil Portenseigne supplied a pure svn patch, actually I had conflicting pending changes locally which prevented me to apply Martin's original patch
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704108 13f79535-47bb-0310-9956-ffa450edef68
For some users, having the week shown in dropdown calendars is an important thing.
There is an option to show week numbers in the dropdown date picker used by OFBiz. (datetimepicker)
It can be done by adding "showWeek: true," in the datetimepicker calls in framework/widget/templates/htmlFormMacroLibrary.ftl.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704086 13f79535-47bb-0310-9956-ffa450edef68
If a userLoginId of an existing user is updated by LoginServices.updateUserLoginId, a new UserLogin value is created with the data of the old one and the old one is disabled afterwards. In addition to switch the enabled flag to "N" the disabledDateTime is set to current date. This is wrong because this makes it possible to reenable the old UserLogin by just do a login with the old userLoginId (standard mechanism to lock the login for a while after subsequent failed login requests).
Thanks Martin Becker for spotting this and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704052 13f79535-47bb-0310-9956-ffa450edef68
This patch introduces some constants for the expression types and corrects the wrong comparison.
Thanks Vyom Jain for spotting this issue and Martin Becker for providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704043 13f79535-47bb-0310-9956-ffa450edef68
Displays the relationship table with alternate colors for better visibility and uses the screenlet pagination controls at top/bottom of the list.
Thanks Christian Carlow for this improvement.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704036 13f79535-47bb-0310-9956-ffa450edef68
Introduces the setLocale methode for ShoppingCartItem and sets the locale for every item if the ShoppingCart setLocale method is called.
Thanks Martin Becker for spotting this and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704018 13f79535-47bb-0310-9956-ffa450edef68
This patch replaces the HashSet with LinkedHashSet for fieldsToSelect because otherwise statusId was being added to the front of the set which was then passed to count distinct query causing incorrect counts. LinkedHashSet preserves the order in which items are added so orderId always appears at the front of the set for the count distinct query.
Thanks Christian Carlow for spotting this and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1704005 13f79535-47bb-0310-9956-ffa450edef68
This removes duplicate code, fixes a methode name typo and adds type safety to an iterator.
Thanks Martin Becker for spotting this and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703977 13f79535-47bb-0310-9956-ffa450edef68
The integer value representing the HOUR was wrong in the documentation.
Thanks Mirco Vogelsmeier for spotting this and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703965 13f79535-47bb-0310-9956-ffa450edef68
Introduces a private inner class ListSet representing a Set backed by a List instead of the HashSet implementation.
Thanks Gareth Carter for spotting this and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703954 13f79535-47bb-0310-9956-ffa450edef68
There is an error in isValidEan util. It should be 12 and not 13 in the methods charAt and calcChecksum because they start at 0.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1703586 13f79535-47bb-0310-9956-ffa450edef68
Rerported by Forrest Rae:
The following functions automatically add a PartyRole entry if the PartyRole does not exist. This is possible even when the userLogin doesn't have PARTYMGR_UPDATE or PARTYMGR_CREATE.
createQuoteRole
createContentRole
createRequirementRole
Repo:
1) Remove PARTYMGR_UPDATE or PARTYMGR_CREATE permissions from the ORDERENTRY group.
2) Login as DemoRepStore
3) Create a Quote
4) Add a QuoteRole with partyId of DemoRepStore and Role of your choosing.
5) View DemoRepStore roles.
This is a security problem for anyone building component that leverages Role based security.
jleroux: simple solution, check before creating the new role the user has PARTYMGR_UPDATE or PARTYMGR_CREATE.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1702704 13f79535-47bb-0310-9956-ffa450edef68