oroinc / platform

Main OroPlatform package with core functionality.
Other
627 stars 351 forks source link

Round function from doctrine-extensions not registered #1067

Open jimohalloran opened 3 years ago

jimohalloran commented 3 years ago

Summary
The oro/doctrine-extensions package provides a round function. However the OroEntityBundle does not register it and it can't be used.

Steps to reproduce
Try to call "ROUND()" in a DQL query (such as that generated from a datagrid) results in an error indicasting that "ROUND()" is an unknown function (Syntax error).

Actual Result Syntax error.

Expected Result
Query is executed and value is rounded as expected.

Details about your environment

Additional information
I can see at https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/EntityBundle/Resources/config/oro/app.yml#L24 a lot of functions provided by this bundle are registered, but round is not. I don't know if there's an issue with the round function specifically, or whether it not being registered is an oversight.

I have registered this function from an app.yml in my own bundle and used it. It does seem to work, so I dopn't understand why platform doesn't register it for you?

x86demon commented 3 years ago

Hi, @jimohalloran Thank you for your response. Doctrine extensions is a separate project that provides a set of useful functions that allow transparent usage of MySQL or PostgreSQL in your application. At the moment platform has no need in the ROUND DQL function, so it was not registered. Registering a new DQL function with app.yml when needed is expected behavior.

jimohalloran commented 3 years ago

Hi @x86demon , Thanks for that info. It seemed odd that most of the functions from that package were registered, but not ROUND(). If this is expected, I assume there are no issues with adding an app.yml into one of my own bundles and registering it? Having done so already, it seems to work fine and I can't see that it could/would break anything.