Checkout field default value set to 0 #40

Closed
opened 2017-02-12 16:29:55 +00:00 by Peeripapo · 4 comments
Peeripapo commented 2017-02-12 16:29:55 +00:00 (Migrated from github.com)

When compiler creates the tables it would be nice for the automatically created fields to have default values. That would allow easier database manipulation.

Unlike created_by and modified_by the checked_out field doesn't have a default value. Is it possible to set this to 0 ?

When compiler creates the tables it would be nice for the automatically created fields to have default values. That would allow easier database manipulation. Unlike created_by and modified_by the checked_out field doesn't have a default value. Is it possible to set this to 0 ?
Peeripapo commented 2017-02-12 17:15:52 +00:00 (Migrated from github.com)

I think this would be possible by changing line 4859 in file "e_interpretation.php" from :

$db .= PHP_EOL."\t`checked_out` INT(11) NOT NULL,";

to

$db .= PHP_EOL."\t`checked_out` INT(11) NOT NULL DEFAULT '0',";

Also, for consistency we could change the params field too (line 4829) from:

$db .= PHP_EOL."\t`params` TEXT NOT NULL,";

to

$db .= PHP_EOL."\t`params` TEXT NOT NULL DEFAULT '',";
I think this would be possible by changing line 4859 in file "e_interpretation.php" from : ``` $db .= PHP_EOL."\t`checked_out` INT(11) NOT NULL,"; ``` to ``` $db .= PHP_EOL."\t`checked_out` INT(11) NOT NULL DEFAULT '0',"; ``` Also, for consistency we could change the params field too (line 4829) from: ``` $db .= PHP_EOL."\t`params` TEXT NOT NULL,"; ``` to ``` $db .= PHP_EOL."\t`params` TEXT NOT NULL DEFAULT '',"; ```

Hi, I am not sure I understand... component builder does have the correct default values for the DB on those fields mentioned.

But yes there is a way to update those default fields (in this tutorial I called How to overwrite the custom fields explain how this is done). I can also add those changes to the core... I will use the Joomla banner table as a guideline

Hi, I am not sure I understand... component builder does have the correct default values for the DB on those fields mentioned. But yes there is a way to update those default fields (in [this tutorial](https://youtu.be/FHQfIhWHYyQ) I called **How to overwrite the custom fields** explain how this is done). I can also add those changes to the core... I will use the [Joomla banner table as a guideline ](https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql#L199)
Peeripapo commented 2017-02-12 17:48:53 +00:00 (Migrated from github.com)

Yes, I'm suggesting changing the core and the defaults I suggested are the same as the #__categories table instead of the #__banners table.

If you change the core the all tables created by JCB will be created with these values as default which will make development easier, at least for me.

In your comment you said you'd use banner table as guide but you linked to the categories table.

Please use the categories table as guideline as it sets default values to all fields.

Hope I helped :)

Yes, I'm suggesting changing the core and the defaults I suggested are the same as the #__categories table instead of the #__banners table. If you change the core the all tables created by JCB will be created with these values as default which will make development easier, at least for me. In your comment you said you'd use banner table as guide but you linked to the categories table. Please use the categories table as guideline as it sets default values to all fields. Hope I helped :)

Sure... that is great.

Sure... that is great.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#40
No description provided.