Commit Graph
28491 Commits
Author SHA1 Message Date
Jacques Le Roux d41d8168c1 Improved: dependabot.yml missed an ASL2 licence header 2022-07-10 10:57:28 +02:00
Nicolas Malin f1c2e8732e Improved: Allow DynamicView use in standard performFind services (OFBIZ-12663)
Extend standard find services (prepareFind, executeFind and performFind) to use a built dynamicView instead of just an entityName.

With this, you can prepare a dedicated dynamicView and call the performFind with on result a database optimisation.

Thanks to Leila Mekika for this proposal and patch
2022-07-08 17:33:30 +02:00
dependabot[bot] 87f86c21ae Bump jquery-validation in /themes/common-theme/webapp/common-theme/js (#519)
Bumps [jquery-validation](https://github.com/jquery-validation/jquery-validation) from 1.19.4 to 1.19.5.
- [Release notes](https://github.com/jquery-validation/jquery-validation/releases)
- [Changelog](https://github.com/jquery-validation/jquery-validation/blob/master/changelog.md)
- [Commits](https://github.com/jquery-validation/jquery-validation/compare/1.19.4...1.19.5)

---
updated-dependencies:
- dependency-name: jquery-validation
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-04 18:10:41 +02:00
dependabot[bot] 5923280441 Bump uglify-js in /themes/common-theme/webapp/common-theme/js (#518)
Bumps [uglify-js](https://github.com/mishoo/UglifyJS) from 3.16.1 to 3.16.2.
- [Release notes](https://github.com/mishoo/UglifyJS/releases)
- [Commits](https://github.com/mishoo/UglifyJS/compare/v3.16.1...v3.16.2)

---
updated-dependencies:
- dependency-name: uglify-js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-04 18:09:49 +02:00
Nicolas Malin 8ee85ec390 Improved: Add sequenceNum field on contentAssoc list (OFBIZ-12654)
By the way, clean unnecessary code and change groovy scripting call by the native date translation

Thanks to Ingo Wolfmayr for this issue
2022-07-01 18:49:06 +02:00
Nicolas Malin 576307ac5c Improved: Add missing parameter on xsd for widget-form:on-field-event-update-area (OFBIZ-12586)
On the widget-form.xsd definition, the element on-field-event-update-area haven't possibility to define some parameters.

But on java code, the on-field-event-update-area is read like on-event-update-area.

If you put some parameters on your code, your editor raise a syntax error but OFBiz analyse and execute it well.

            <wf:field name="reload" >
                <wf:submit/>
                <wf:on-field-event-update-area event-type="click"
                                               area-target="ReloadIt">
                    <wf:auto-parameters-service service-name="computeForReload" send-if-empty="false"/>
                </wf:on-field-event-update-area>
            </wf:field>

By the way we can synchronize the on-field-event-update-area xsd on on-event-update-area.
2022-07-01 18:31:41 +02:00
Nicolas Malin e0f61dceb7 Improved: Convert a display-entity to hyperlink if subhyperlink this empty (OFBIZ-12547)
When you define a display-entity you have the possibility to add a sub-hyperlink related to the element displayed.

             <field name="partyIdFrom">
                <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName}${firstName} ${lastName}">
                    <sub-hyperlink target="viewprofile" description="view">...</sub-hyperlink>
                </display-entity>
            <field>

This display the party name with a link "view" connected.

When you use the name as link without a dedicate sub link, you need to change all the form to resolve the information to display for creating an hyperlink

            <row-actions>
                <entity-one entity-name="PartyNameView" value-field="partyName">
                        <field-map field-name="partyId" from-field="partyIdFrom"/>
                </entity-one>
                <set field="partyNameValue" value=" ${partyName.groupName}${partyName.firstName} ${partyName.lastName}"/>
            </row-actions>
            <field name="partyIdFrom">
                <hyperlink target="viewprofile" description="${partyNameValue}">..</hyperlink>
            </field>

We lost the advantage of the display-entity. With this case, we improve display-entity with the following rule :

If the display-entity has a subhyperlink and the subhyperlink haven't description, the description of the link is the display-entity description.
In the code, if a sub-hyperlink has an empty description, we convert the display entity as a hyperlink
2022-07-01 18:21:49 +02:00
Nicolas Malin 8015dcb02d Improved: Refactoring service resenquence (OFBIZ-12624)
The service "resequence" compute for a content all sequenceNum for linked content assoc.

The code is very old (before apache) so apply a slim refactor and migrate the service name resequence to resequenceContentAssocChildren.

By the way I kept the service definition resequence to move it as deprecated.
2022-07-01 18:04:45 +02:00
Nicolas Malin 7ea371bde3 Fixed: MenuItem doesn't follow correctly extended informations (OFBIZ-12628)
Fix a null pointer exception when the extended menu have an entry without link.

Thanks to Jacques Leroux for the alert
2022-07-01 17:37:14 +02:00
Jacques Le Roux 78ee6f8792 Improved: CustomSafePolicy, also use TagBalancingHtmlStreamEventReceiver (OFBIZ-12653)
Adds <img> and <hr> to CustomSafePolicy, removes obsolete <tt>. <img> allows
only attributes src and alt.

Both <br> and <br /> are correct. For that, this rather uses
TagBalancingHtmlStreamEventReceiver

Thanks: Ingo Wolfmayr
2022-07-01 17:26:18 +02:00
Jacques Le Roux 415b0124fe Improved: Helveticus App-Bar Css Issue - Height change on hover (OFBIZ-12661)
When hovering an app-navigation item, the height of the app bar changes.
Doesn't look good. Attached the correction.

Thanks: Ingo Wolfmayr
2022-06-29 10:52:55 +02:00
Jacques Le Roux 9abd236284 Improved: Update build.gradle to the latest dependencies (OFBIZ-12658)
Reverts asciidoctorj-pdf to 1.5.3

Not sure it will work, at least I have a (another?) problem locally in Win 7
2022-06-29 10:45:34 +02:00
Jacques Le Roux 56fd07118b Improved: Update build.gradle to the latest dependencies (OFBIZ-12658)
Reverts tika-core to 1.28.4 and fop to 2.3

I did not launch the tests, those did not pass:
ecommercetests	testSendOrderConfirmation
widgettests testFopMacroLibrary

Tika is a bit annoying, no security releases after Sept. 30
2022-06-28 19:29:17 +02:00
Jacques Le Roux 5dc416c3c6 Improved: Runs GitHub Gradle build with Java 11
New line just to apply change made in Buildbot config to run w/ Java 11

Thanks to Gavin who noticed I forgot one line in Buildbot config  :/
2022-06-27 20:21:27 +02:00
Jacques Le Roux 1bce4deb5e Improved: Runs GitHub Gradle build with Java 11
New line just to apply change made in Buildbot config to run w/ Java 11

Seems last time Buildbot did not catch up or something is wrong
I double checked Buildbot config is properly set to run w/ Java 11 and change is
committed

Trying again after Gavin confirmed it should be OK on Slack #asfinfra channel
2022-06-27 19:54:35 +02:00
Jacques Le Roux e4777decb4 Improved: Runs GitHub Gradle build with Java 11
New line just to apply change made in Buildbot config to run w/ Java 11

Seems last time Buildbot did not catch up or something is wrong
I double checked Buildbot config is properly set to run w/ Java 11 and change is
committed
2022-06-27 19:15:08 +02:00
Jacques Le Roux a5d949ecde Improved: Runs GitHub Gradle build with Java 11
Trivial change just to apply change made in Buildbot config to run w/ Java 11
2022-06-27 18:39:17 +02:00
Jacques Le Roux 65c766e0c9 Improved: Runs GitHub Gradle build with Java 11 2022-06-27 18:07:28 +02:00
Jacques Le Roux 18d0d75f43 Improved: Update build.gradle to the latest dependencies (OFBIZ-12658)
I noticed that JpegImageParser from Apache Commons Imaging never had a write
option. So I commented it out. I tested uploading, it's OK

org.apache.axiom.om.impl.builder.StAXOMBuilder has been replaced by
org.apache.axiom.om.OMXMLParserWrapper
in SOAPEventHandler.java

The rest of information is in the main build.gradle

I got 2 test errors on Win7. I'll see how it goes on GH and BB.
Maybe it's write.lock issues with Lucene or/and Solr indexes
2022-06-27 15:40:08 +02:00
Jacques Le Roux 80fc052d22 Fixed: [SECURITY] Upgrade Tika to 1.28.4 (OFBIZ-12657)
Mentionned at https://tika.apache.org/
Apache Tika 1.28.4 has been released! This release includes security related
fixes and dependency upgrades
Note: The Apache Tika PMC has set September 30, 2022 as the End Of Life for the
Tika 1.x branch.
2022-06-22 13:52:33 +02:00
Jacques Le Roux 14c58a11c8 Improved: OWASP sanitizer breaks proper rendering of HTML code (OFBIZ-12653)
Allows both <br> and <br /> to pass in UtilCodec::checkStringForHtmlSafe, both
are correct.

Clarifies owasp.properties documentation about how to create own sanitizer
policies
2022-06-21 20:57:37 +02:00
dependabot[bot] a2dbc689fe Bump uglify-js in /themes/common-theme/webapp/common-theme/js (#516)
Bumps [uglify-js](https://github.com/mishoo/UglifyJS) from 3.15.4 to 3.16.1.
- [Release notes](https://github.com/mishoo/UglifyJS/releases)
- [Commits](https://github.com/mishoo/UglifyJS/compare/v3.15.4...v3.16.1)

---
updated-dependencies:
- dependency-name: uglify-js
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-17 17:38:07 +02:00
Jacques Le Roux a88bd3b410 Improved: Update npm dependencies to the latest (OFBIZ-12596)
Dependabot does not support paths with "\" as in Windows
2022-06-17 15:44:20 +02:00
Jacques Le Roux 427bc85666 Improved: Update npm dependencies to the latest (OFBIZ-12596)
This supersedes the usage of npx npm-check-updates by automating npm things with Dependabot in GH
2022-06-17 15:28:15 +02:00
Nicolas Malin 59617b38ac Fixed: Service getNextOrderId failed if a customMethod is present (OFBIZ-12651)
When you generate an order on a party who have a PartyAcctgPreference with a customMethod orderSequence_enforced, the service failed due to the missing parameter partyAcctgPreference.

Like quote and invoice it's preferable to forward the partyAcctgPreference information.
2022-06-17 13:45:03 +02:00
Nicolas Malin 41dd06b72f Fixed: MenuItem doesn't follow correctly extended informations (OFBIZ-12628)
When you use two menus where the second extend the first, menu items and menu links aren't correctly propagated.

The menu items and menu links presents on the second menu already have the first menu on their model.

    ****
    <menu name="FirstMenu" extends="CommonInlineBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
        <menu-item name="MyItem">
            <link target="GoAction"/>
        </menu-item>
    </menu>
    <menu name="SecondMenu" extends="FirstMenu"/>
    ****

The result, if during the rendering some information are generated from the menu, in the previous case, it's always the "FirstMenu" that would be use.

Like when your menu generate a hidden-form, the SecondMenu link the bad form

    ****
    <form method="post" action="GoAction" onsubmit="javascript:submitFormDisableSubmits(this)" name="SecondMenu">...</form>
    <a href="javascript:ajaxSubmitFormUpdateAreas('FirstMenu', 'xxx')">MyItem</a>
    ****

To solve it and don't break the thread safe pattern, I introduce two new constructor for ModelItem and MenuLink for duplicate the ModelMenuItem and MenuLink in memory with the new parent. With this, the SecondMenu iw now completely duplicated on memory and now share any reference with the extended menu.

Thanks to Marco Rodrigues that detect this problem
2022-06-17 11:19:22 +02:00
Nicolas Malin 1042b0fc47 Fixed: Function ProductWorker.shippingApplies failed if chargeShipping is empty (OFBIZ-12649)
No functional change (correction on trunk already did by the OFBIZ-12609)

Condensing the code and remove unused errMsg variable.
2022-06-17 10:19:17 +02:00
Jacques Le Roux 84d30a5abc Improved: Unable to upload a file through ecommerce (OFBIZ-12636)
Allows to check for only CSV files. This is not used OOTB in OFBiz.

Thanks: Sachin for report and confirmation it's OK
2022-06-16 17:43:49 +02:00
Jacques Le Roux 26c209f8b4 Fixed: CategoryContentAssoc form vs. grid (OFBIZ-12641)
ScreenWidget links to form  but should be grid.

Thanks: Ingo Wolfmayr
2022-06-14 17:13:18 +02:00
Jacques Le Roux e4f1abfbdc Fixed: Wrong location for service updateContentSEOCategory (OFBIZ-12642)
Service has been moved to groovy but definition still links to minilang.

Thanks: Ingo Wolfmayr
2022-06-14 17:10:53 +02:00
Jacques Le Roux bf12a58826 Improved: updates codeQL to V2 as asked at
https://github.com/apache/ofbiz-framework/actions/runs/2479996158
2022-06-11 16:47:51 +02:00
Jacques Le Roux 658552e4fb Improved: Secure the uploads (OFBIZ-12080)
Few more debug log texts changes for clarity

I backport to ease future merging while backporting
2022-06-11 14:45:09 +02:00
Jacques Le Roux e3f5d31db1 Fixed: Secure the uploads (OFBIZ-12080)
Several changes in SecuredUpload class:
Mostly checks that uploaded CSV files are valid text files
Also few debug log texts changes for clarity
2022-06-11 11:09:26 +02:00
Jacques Le Roux 61645a72c4 Fixed: Unable to upload a file through ecommerce (OFBIZ-12636)
We need to upload a CSV format file as part of project requirement
We were able upload CSV format file under eCommerce in Version 16.11.07.
We are trying to implement the same in version 18.12.05 - there the same upload
module does not work.

jleroux: I missed to check and allow CSV files when all files are allowed.
That now uses:
https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html

The default CSV format used to check upload of CSV files is set in the property
csvformat=CSVFormat.DEFAULT in security.properties

Thanks: Sachin for report
2022-06-11 08:57:36 +02:00
Deepak Dixit 5e29578ad6 Fixed: Added missing notification tag entry in services.xsd file (OFBIZ-12635) 2022-06-09 15:28:24 +05:30
Michael Brohl d52ded8f54 Improved: Regular expression denial of service in jquery-validation
(OFBIZ-12634)
2022-06-07 22:32:49 +02:00
Michael Brohl a70342279f Improved: German Translation - Category (OFBIZ-12632)
Updates a few german translations for consistency.

Thanks Ingo Wolfmayr for reporting and providing the patch.
2022-06-07 21:27:58 +02:00
Jacques Le Roux ae146e02ef Improved: XML Import fails due to security check (OFBIZ-12602)
Hide the "Received a null Security object from HttpServletRequest" warning when
ControlFilter is in the StackTrace.
2022-06-07 12:04:05 +02:00
Jacques Le Roux 253515f3a5 Improved: Update Groovy to 2.5.17 (OFBIZ-12631)
This release includes 23 bug fixes/improvements as outlined in the changelog:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12318123&version=12351416
2022-06-03 12:03:06 +02:00
Jacques Le Roux 6e85417469 Improved: Some translation cosmetics (OFBIZ-12627)
Thanks: Ingo Wolfmayr
2022-06-02 09:42:27 +02:00
Jacques Le Roux 812aaae07c Fixed: [SECURITY] Upgrade Tika to 1.28.3 (OFBIZ-12626)
Apache Tika 1.28.3 contains security-related fixes and dependency upgrades.
Details can be found in the changes file:
https://www.apache.org/dist/tika/1.28.3/CHANGES-1.28.3.txt
2022-05-28 10:04:33 +02:00
Leila 3cc30333d0 Manage groovy DSL error message retrieval (OFBIZ-10692)
Add integration test to validate the good retrieval of the success /
error message.

Ajout de 4 services groovy pour tester le fonctionnement du moteur de service en groovy couplé a des appels de type DSL
2022-05-27 16:27:03 +02:00
Jacques Le Roux 088b22235d Improved: Json response failed when element not serializable (OFBIZ-12621)
No functional changes, just removing a compilation warning

While compiling with Java 11 I got this message:
> Task :compileJava
UtilHttp.java:502: warning: [unchecked] unchecked call to
<R>map(Function<? super T,? extends R>) as a member of the raw type Stream
[...]

This fixes it with the help of Eclipse
2022-05-26 12:24:49 +02:00
Jacques Le Roux b94b6aecaf Fixed: Webtools Service Logs ‘Service Name’ column always empty (OFBIZ-12625)
rs.getModelService().getName() should be used
instead of
rs.getModelService().name

The rest of changes is only non functional formatting and such

Thanks: Emad Radwan for reporting
2022-05-26 11:27:55 +02:00
Nicolas Malin 09cf6eb499 Improved: Redirect unauthenticated user to login on AJAX calls (OFBIZ-12620)
At this time when you aren't logged and you need to be authenticated for access to a page, OFBiz return the login page with a http code 200

This set a problem for ajax call to understand why the page returned isn't the attendee/

This improvement does 3 things :
   * return a HTTP status code 401 (Unauthorized) in LoginWorker::checkLogin if user is not authenticated (no more 200),
   * in common-theme, OfbizUtil.js, on AJAX calls handler, if the request fails with a 401 status code, reload current page (so we land on login form instead of being stuck in a blank modal) with a new search param `clickOn` containing the id of the link that triggered the AJAX call,
   * on page load, if `clickOn` search parameter exists, trigger a click event on the link, so the initial modal pops in after a successful login

Thanks to Florian Motteau for this improvement
2022-05-25 15:38:39 +02:00
Nicolas Malin 82f25f6192 Fixed: Json response failed when element not serializable (OFBIZ-12621)
When you forward a request-map on json response after a service call like this :

     <request-map uri="updateMyEntity">
        <security https="true" auth="true"/>
        <event type="service" invoke="serviceWithUnserializableElement"/>
        <response name="success" type="request" value="json"/>
        <response name="error" type="request" value="json"/>
    </request-map>

The request json works fine if the serviceWithUnserializableElement have an element unserializable on out put at the first level

     <service name="serviceWithUnserializableElement"...>
        <attribute name="outputStream" type="java.io.OutputStream" mode="OUT"/>
     </service>

If the definition is like this

     <service name="serviceWithUnserializableElement"...>
        <attribute name="outputStreamMap" type="Map" mode="OUT"/>
     </service>

The json failed to generate if the outputStream is a map. despite the function UtilHttp.getJSONAttributeMap that safe only the first map level and don't work in deep.

By the way, we improved the getJSONAttributeMap to work in deep by a recursive treatment on Map and List.
2022-05-25 14:35:36 +02:00
Nicolas Malin 4d035a554b Implemented: Configure invoice, quote and order templates for an organizational party (OFBIZ-10215) (OFBIZ-10216) (OFBIZ-10217)
Add the possibility to print invoice, quote and order as pdf from the organizational party configuration.

With this you can define your own xslfo template connected to a custom screen and configure it for each organization through PartyPrefDocTypeTpl

Thanks to Ingo Wolfmayr for patch submission
2022-05-25 13:59:41 +02:00
Jacques Le Roux 3f5536dc54 Tested: No status emails sent to commits@ofbiz.apache.org (INFRA-22689)
After migrating OFBiz BuildBot 0.8 config to 3.2 we no longer receive status
emails (success, failure, exception) to commits@ofbiz.apache.org (answering to
dev@ofbiz.apache.org)

Removes the commented out <<ProductStore storeName="OFBiz E-Commerce Store">>
to hopefully get a successful email from BuildBot

I modified the BuildBot config to test BuildBot sends only emails on status
changes
2022-05-24 17:11:25 +02:00
Jacques Le Roux c5acfa0892 Tested: No status emails sent to commits@ofbiz.apache.org (INFRA-22689)
After migrating OFBiz BuildBot 0.8 config to 3.2 we no longer receive status
emails (success, failure, exception) to commits@ofbiz.apache.org (answering to
dev@ofbiz.apache.org)

Comments out <<ProductStore storeName="OFBiz E-Commerce Store">> to get failing
tests and an email from BuildBot to later removes that to get a successful email

Thanks: Chris Lambertus for last change that always send an email. As sending
emails  works for "all" changes to "change" this to test what we are really
interested in.
2022-05-24 16:53:20 +02:00
Pierre Smits 5d8d7e9f55 Improved: Quote Search-Find - Consistency in UX (OFBIZ-12506) (#462)
Throughout the various components the screens to find a particular record (or multiple) are structured the same way with a decorator-screen called 'FindScreenDecorator' and in there decorator section for 'search-options' and 'search-results', bringing to the users a consistent experience.
The search and find functionality for quotes does not adhere to that paradigm.

modified: QuoteScreens.xml
restructured FindQuote screen to align with paradigm applied to the same vis-a-vis
searching and finding other kinds of records, additional cleanup.

jleroux: very minor changes to test INFRA-22689 "No status emails sent to commits@ofbiz.apache.org"
2022-05-24 11:18:42 +02:00