Date field does not use field settings when installing #937

Closed
opened 2022-07-20 16:27:50 +00:00 by SimonvanDoorne · 4 comments
Member

Steps to reproduce the issue

  1. create field (in this case 'availability_start)' and set default settings to something other than the stock default
    image
  2. install component

Expected result

Correct install of component

Actual result

Error "Invalid default value for field"
image

System information (as much as possible)

  • OS Name & Version: Windows
  • MySql Version:
  • Apache Version:
  • PHP Version: 7.4
  • Joomla Version: 3.10.10
  • JCB Version: 3.1.4
  • Browser: Firefox

Additional comments

I can edit the sql install line in the component settings but i really shouldn't have to do that for a simple date field (in my opinion).

### Steps to reproduce the issue 1) create field (in this case 'availability_start)' and set default settings to something other than the stock default ![image](/attachments/d1f84efe-245e-4fdd-95f3-80e678c7efbc) 2) install component ### Expected result Correct install of component ### Actual result Error "Invalid default value for field" ![image](/attachments/5fb1f22c-bca7-427a-b28e-912bd7846d77) ### System information (as much as possible) - OS Name & Version: Windows - MySql Version: - Apache Version: - PHP Version: 7.4 - Joomla Version: 3.10.10 - JCB Version: 3.1.4 - Browser: Firefox ### Additional comments I can edit the sql install line in the component settings but i really shouldn't have to do that for a simple date field (in my opinion).
Author
Member

When i copy the field it does create the correct sql query. After changing the settings in the new field it also does not update in the install query. It looks like only the initial saved settings (aka the first time you click save) are actually saved to the install query.
image

When i copy the field it does create the correct sql query. After changing the settings in the new field it also does not update in the install query. It looks like only the initial saved settings (aka the first time you click save) are actually saved to the install query. ![image](/attachments/49174b94-7d8f-4fd6-861a-8aa589206ee1)
4.3 KiB
Owner

Okay so it does not use the default you set, did I understand you correctly.

You want it to use '0000-00-00' instead of the '' it is using now.

Okay so it does not use the default you set, did I understand you correctly. You want it to use `'0000-00-00'` instead of the `''` it is using now.
Author
Member

That is correct. Moreover it does not matter what changes i make in the field defition since only the first save is used in the install.

That is correct. Moreover it does not matter what changes i make in the field defition since only the first save is used in the install.
Owner

There are only a few things that will cause a sql update of a column.
Basicly changed name and/or data type and data lenght will effect an sql update of a field, not a change of the default value.

The fact that it does not use the default you set is something I will look at, as for the not updating when you make a change, we will need more details on exactly what changes you are talking about.

There are only a few things that will cause a sql update of a column. Basicly changed name and/or data type and data lenght will effect an sql update of a field, not a change of the default value. The fact that it does not use the default you set is something I will look at, as for the not updating when you make a change, we will need more details on exactly what changes you are talking about.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#937
No description provided.