Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOUR-12716: PMQL "lower" function is not working correctly #5779

Merged
merged 1 commit into from Dec 8, 2023

Conversation

eiresendez
Copy link
Contributor

@eiresendez eiresendez commented Dec 6, 2023

Issue & Reproduction Steps

The pmql should support the use of the function Lower.

  1. Create a new PHP script
  2. Use the attached PHP script (see JIRA ticket).
  3. Execute the script.

After running the script the error displayed is “SERVER ERROR“. Only if you remove the lower function the pmql works.

Solution

When using a JSON field (data.example) and applying the lower function, the following error occurs:

An object of the Illuminate\Database\Query\Expression class cannot be converted to a string.

This happens because Expression is an object that cannot be directly converted into a string.

This issue likely emerged due to the version upgrade from Laravel 8 to Laravel 10. In Laravel 8, the __toString() method existed, but in Laravel 10,this method was removed. Now, to access the value, it is necessary to use the getValue($grammar) method.

Documentation for Laravel 10 and 8:

How to Test

Run php artisan test --filter ExtendedPMQLTest::testLowerFunction.

Related Tickets & Packages

ci:pmql:bug/FOUR-12716

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

Copy link

@ryancooley ryancooley merged commit 90f29b9 into develop Dec 8, 2023
13 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants