User tests: Successful: Unsuccessful:
Pull Request for Issue # .
Add default value 0 to the "hits" field in the admin form of the article.
Create an article, duplicate it.
In this case trying to save the duplicated article cause : '' is not a valid integer on save
The field hits is blank and is not be set to a valid integer in the query
This not happen all the time. Why ?
An integer must have a default valid value if it is save in the database or be set to NULL if it is allowed in the table
Saving article cause : '' is not a valid integer
Article saved with default hits to 0
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content JavaScript Repository NPM Change |
Title |
|
Labels |
Added:
Information Required
NPM Resource Changed
?
|
Category | Administration com_content JavaScript Repository NPM Change | ⇒ | Administration com_content |
Labels |
Removed:
NPM Resource Changed
|
I have tested this item
To reproduce:
Edit an article.
Go to Publishing tab.
Use browser's inspector to change the value of Hits to empty string.
Click Save button.
I have tested this item
Followed the procedure given by BertaOctech
Status | Pending | ⇒ | Ready to Commit |
RTC
Indeed this is the fastest way to reproduce the error.
I have only described in which case it occurred on my side ... it is not systematic as I specified.
I made the most obvious correction but for me there is clearly a problem in the form validation process on the server side.
Since the field is defined as an integer, even without a default value, it should be initialized to 0 no matter what, '' is not an integer.
Maybe there is an hidden error in the integer definition filter.
I think if this happens for this field, then all forms with none initialized integer should be reviewed.
This error is no need to be reproduce for this patch but...
I checked the category hits field and the default to 0 is present.
If you remove the default of the field 'hits' (category or article) and follow the @Quy instruction, you will get the error.
You can also enter a string instead of an integer and the string will be convert to empty string.
Incorrect integer value: '' for column 'hits' at row 1
This kind of error must not happen on the server side validation because everybody can make a form like he want, specially with the API
The form validation does not make its job if a value is set to string for an integer with no default, the default should be 0 on all case or the form is not valid
Labels |
Added:
?
Removed: Information Required |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-09-09 07:58:16 |
Closed_By | ⇒ | laoneo |
Thanks!
Hi.
I have not been able to reproduce the issue.
I have created 2 articles, I have visited only one of them. In this way I have one article with hits = 0 and another one with hits > 0.
In both cases, when I used "Save as Copy" a new article was created, and the message "Article saved." appeared.
I have tried in Chrome and Firefox.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30523.