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

FIX: deleteObjectLinked() element value matching add_object_linked() #32886

Open
wants to merge 1 commit into
base: 20.0
Choose a base branch
from

Conversation

altairis-noe
Copy link
Contributor

FIX: deleteObjectLinked() element value matching add_object_linked()

CommonObject::add_object_linked() uses CommonObject::getElementType() to set element type in db. So should CommonObject::deleteObjectLinked(), or we might not delete previously created links

@eldy
Copy link
Member

eldy commented Feb 2, 2025

Can you describe how to reproduce the bug from screen ?
If you can't from screen, PR must be pushed into develop as it means it is a code quality enhancement.

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Feb 2, 2025
@altairis-noe
Copy link
Contributor Author

I wouldn’t say code quality enhancement, but it wouldn’t show in Dolibarr screen either.
I’ll try and describe the use case.
I have a module in custom named module, with an object in it. I use $object->add_object_link() in, let’s say, an order.
In table llx_element_element, I will have

sourcetype => module_object, targettype => commande

If I delete my object, or call deleteObjectLink() for some reason, as $element is object and not module_object, the entry in element_element will stay there, causing unwanted (and potentially misleading) information to rot in the database.
This PR corrects that.
So this is not QUAL, imo, this is FIX!

@altairis-noe
Copy link
Contributor Author

Does it make sense for you, @eldy ?

@eldy
Copy link
Member

eldy commented Feb 4, 2025

Does it make sense for you, @eldy ?

As this affect only external module, this can't be categorized as a bug of dolibarr, but as an enhancement to allow a use case provided by external modules that is not yet possible. So you must push it into develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants