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

Module Builder creates invalid SQL when using chkbxlst #31545

Open
jeff-techstension opened this issue Oct 25, 2024 · 1 comment
Open

Module Builder creates invalid SQL when using chkbxlst #31545

jeff-techstension opened this issue Oct 25, 2024 · 1 comment
Assignees
Labels
Bug This is a bug (something does not work as expected)

Comments

@jeff-techstension
Copy link

Bug

When building an object for a custom module with the chkbxlst type the column type becomes chkbxlst instead of text. This prevents the table from being able to be created.

public $fields=array(
		"rowid" => array("type"=>"integer", "label"=>"TechnicalID", "enabled"=>"1", 'position'=>1, 'notnull'=>1, "visible"=>"0", "noteditable"=>"1", "index"=>"1", "css"=>"left", "comment"=>"Id"),
		
"fk_filepurpose" => array("type"=>"chkbxlst:c_filepurpose:label:rowid", "label"=>"FilePurpose", "enabled"=>"1", 'position'=>120, 'notnull'=>1, "visible"=>"1", "index"=>"1", "css"=>"maxwidth500 widthcentpercentminusxx", "csslist"=>"tdoverflowmax150", "help"=>"Link to the file purpose", "validate"=>"1",)
	);

This is an example of the SQL that it generates

CREATE TABLE llx_filepurpose_filepurposeassociation(
	-- BEGIN MODULEBUILDER FIELDS
	rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 
	fk_filepurpose chkbxlst NOT NULL, 
	-- END MODULEBUILDER FIELDS
) ENGINE=innodb;

Dolibarr Version

20.0.1

Environment PHP

8.2

Environment Database

MariaDb 11.5.2-ubi9

Steps to reproduce the behavior and expected behavior

  1. Create a custom module using the rad builder
  2. Create a new object through the UI
  3. Add a column with type chkbxlst
  4. Generate the SQL
  5. View the objectname_modulename.sql file
  6. check the column and see chkbxlst as the type.

Attached files

No response

@jeff-techstension jeff-techstension added the Bug This is a bug (something does not work as expected) label Oct 25, 2024
@bafbes bafbes self-assigned this Nov 15, 2024
@bafbes
Copy link
Contributor

bafbes commented Nov 15, 2024

Fixed in #31923

eldy added a commit that referenced this issue Nov 15, 2024
#31923)

* fix bug Module Builder creates invalid SQL when using chkbxlst #31545 in #31545

* Update modulebuilder.lib.php

---------

Co-authored-by: abb <[email protected]>
Co-authored-by: Laurent Destailleur <[email protected]>
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

2 participants