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

PHP warning on updating html type extrafield #29229

Closed
code42fr opened this issue Apr 4, 2024 · 0 comments
Closed

PHP warning on updating html type extrafield #29229

code42fr opened this issue Apr 4, 2024 · 0 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@code42fr
Copy link
Contributor

code42fr commented Apr 4, 2024

Bug

On the update() function of extrafields.class.php file, when we update extrafield as html type, the variable $lengthdb is not set. It generate a php warning.

This error doesn't appear on extrafield edit page (like "/societe/admin/societe_extrafields.php" page or others) because when we update, we reload the page but it is still present even if we can't see it. This is not a problem on these pages but if we update an extrafield from module descriptor, the page isn't reloaded and we can see this warning :

Capture d’écran 2024-04-04 à 09 56 51

The page can't be loaded because of the warning.

The probleme comes from extrafields.class.php, in update() function l.606 :
Capture d’écran 2024-04-04 à 14 26 04

Dolibarr Version

19.0.01

Environment PHP

8.2.10

Environment Database

MySQL or MariaDB 8.0.31-0ubuntu0.20.04.2

Steps to reproduce the behavior and expected behavior

Update an extrafield in module descriptor :

$extrafields = new Extrafields($this->db);
$res = $extrafields->update("extrafieldtest", "Test", "html", 2000, societe);

Activate the module.

Attached files

No response

@code42fr code42fr added the Bug This is a bug (something does not work as expected) label Apr 4, 2024
PsyCrow-code added a commit to PsyCrow-code/dolibarr that referenced this issue Apr 6, 2024
@eldy eldy closed this as completed in 01d8261 Apr 8, 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

1 participant