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

Link type extrafields on supplier order line are no longer working #29333

Closed
IC-Ilies opened this issue Apr 12, 2024 · 5 comments
Closed

Link type extrafields on supplier order line are no longer working #29333

IC-Ilies opened this issue Apr 12, 2024 · 5 comments
Assignees
Labels
Bug This is a bug (something does not work as expected)

Comments

@IC-Ilies
Copy link
Contributor

Bug

Hello,

When i attempted to create an extrafield (link to an other object) on a supplier order line, this error showed up :
selectForForms: Error bad setup of field objectdescorig=Contact, objectfield=commande_fournisseurdet:options_buyprice

Capture d’écran du 2024-04-12 11-01-26

I already found the origin of this bug and i will make a pull request, but i suspect that this problem will possibily occur on many other elements, since the problem comes from the 'getElementProperties' function (core/lib/functions.lib.php) and that many elements may not have been integrated into this function (maybe)
Capture d’écran du 2024-04-12 11-05-05

Dolibarr Version

19.0.1

Environment PHP

8.1.27

Environment Database

10.5.23-MariaDB

Steps to reproduce the behavior and expected behavior

Set up an extrafield of type link on supplier order lines (from code or dolibarr's interface)
Link it to whatever you want (even the basic examples provided into the help tooltip)
Create it
When you go to the line form on any order supplier, you'll see the error

Attached files

No response

@IC-Ilies IC-Ilies added the Bug This is a bug (something does not work as expected) label Apr 12, 2024
@IC-Ilies IC-Ilies self-assigned this Apr 12, 2024
IC-Ilies added a commit to IC-Ilies/dolibarr that referenced this issue Apr 12, 2024
@JonBendtsen
Copy link
Contributor

@IC-Ilies what if you searched for the old text string(s) in other modules? would you then find them?

@IC-Ilies
Copy link
Contributor Author

@IC-Ilies what if you searched for the old text string(s) in other modules? would you then find them?

I don't think it is as simple as that, because i would have to search for every class that has en element attribute that is not in correlation with it's name (and there is a lot of dolibarr classes :p ) . For now i think i will just check the issues and let this one open if another similar bug shows

@eldy
Copy link
Member

eldy commented Apr 14, 2024

Can you provide the definition (screenshot of extrafield setup) of your extrafield coefficient ?

@IC-Ilies
Copy link
Contributor Author

image

@eldy Here it is :)

@eldy
Copy link
Member

eldy commented Apr 15, 2024

So yes, trouble is surely into
getElementProperties that does not handle all the cases, you can send a pr to add support for commande_fournisseurdet
Previoudly all cases non standard were handled at different places. We introduced getElementProperties to have this handled in 1 place only but may have forgotten cases...

@eldy eldy closed this as completed in de1d67a Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

3 participants