? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
6 Nov 2019

Pull Request for Issue #27001 .

Summary of Changes

Check if featured up and down are set in data before calling the featured routine.

With PR #25979 scheduling of featuring articles has been implemented.

During development of this PR, the 2 new database columns have been moved from table #__content to table #__content_frontpage. This change introduced errors which obviously have not been noticed when testing that PR. Some other errors caused by this have already been fixed, see e.g. PR #26829 . This PR here fixes another of these errors.

The error happens with blog sample data and testing sample data. But testing sample data needs in addition PR #26392 , so the test of blog sample data is easier and should be sufficient. The error fixed here is the same for both.

Testing Instructions

  1. Install Blog Sample Data and watch the PHP error log (with error reporting set to "maximum" or "development").

  2. Edit an article or create a new one, set the featured option to "Yes", and in the fields for feature start and end which appear then, enter some times. Click "save and close" to save the article and close the edit view.

  3. Edit the article again which you have edited in step 2. Check if the dates and times entered in step 2 for featured start and end are still the same.

Expected result

For step 1: No PHP notices.

For step 3: The dates and times are still the same, i.e. they were correctly saved in database.

Actual result

For step 1: There are 2 PHP Notices:

PHP Notice: Undefined index: featured_up in \administrator\components\com_content\Model\ArticleModel.php on line 950
PHP Notice: Undefined index: featured_down in \administrator\components\com_content\Model\ArticleModel.php on line 950

For step 3: See expected result.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 6 Nov 2019
avatar richard67 richard67 - change - 6 Nov 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Nov 2019
Category Administration com_content
avatar richard67
richard67 - comment - 6 Nov 2019

@wilsonge Please review, and read also what I wrote in summary of changes about fixing the diverse sample data in addition, and that I am not sure if this PR fixes the issue in the right way.

Update: I think this featured up and down thing needs to be a bit redesigned, too, maybe together with workflows v2, because like it is made now that the table class of the content table reads also data from content_frontpage table seems to be wrong to me, I think such stuff belongs into models or maybe a helper. But I am not deep enough into Joomla 4 architecture to be sure with that or to be able to redesign that functionality in the right way, at least not without help/advice.

avatar richard67 richard67 - change - 6 Nov 2019
Title
[4.0] Fix failing blog sample data installation caused by unset featured_up and featured_down
[4.0] Fix failing sample data installation caused by unset featured_up and featured_down
avatar richard67 richard67 - edited - 6 Nov 2019
avatar richard67 richard67 - change - 6 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 6 Nov 2019
avatar wilsonge
wilsonge - comment - 6 Nov 2019

Multilang sample data was inserting data directly to the frontpage table and got patched already - so I don't think this will be an issue there. I think this looks like the correct fix for me. These values are nullable so shouldn't be required on store

avatar richard67
richard67 - comment - 6 Nov 2019

Yes, I meanwhile also got more confident and think it is a correct fix. Now it only needs 2 testers ;-)

avatar richard67 richard67 - change - 6 Nov 2019
Labels Added: ?
avatar richard67 richard67 - change - 6 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 6 Nov 2019
avatar richard67 richard67 - change - 6 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 6 Nov 2019
avatar richard67 richard67 - change - 6 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 6 Nov 2019
avatar richard67 richard67 - change - 6 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 6 Nov 2019
avatar richard67 richard67 - change - 6 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 6 Nov 2019
avatar Quy Quy - test_item - 6 Nov 2019 - Tested successfully
avatar Quy
Quy - comment - 6 Nov 2019

I have tested this item successfully on d4bcf24


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27008.

avatar richard67 richard67 - change - 7 Nov 2019
The description was changed
avatar richard67 richard67 - edited - 7 Nov 2019
avatar infograf768 infograf768 - test_item - 7 Nov 2019 - Tested successfully
avatar infograf768
infograf768 - comment - 7 Nov 2019

I have tested this item successfully on d4bcf24


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27008.

avatar infograf768 infograf768 - change - 7 Nov 2019
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 7 Nov 2019

rtc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27008.

avatar infograf768 infograf768 - change - 7 Nov 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-11-07 10:59:54
Closed_By infograf768
Labels Added: ?
avatar infograf768 infograf768 - close - 7 Nov 2019
avatar infograf768 infograf768 - merge - 7 Nov 2019
avatar infograf768
infograf768 - comment - 7 Nov 2019

tks

avatar richard67
richard67 - comment - 7 Nov 2019

Thanks.

Add a Comment

Login with GitHub to post a comment