Correcting Notice when saving Global Configuration#13612
Correcting Notice when saving Global Configuration#13612wilsonge merged 2 commits intojoomla:stagingfrom
Conversation
|
@franz-wohlkoenig |
|
The easiest way to see error is adding this command die(); after this line https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_config/model/application.php#L387 I think $data['cache_path'] is always available, so actually, to prevent the notice, we only have to check !empty($prev['cache_path']) So the code would become: if ($data['cache_path'])
{
$path = $data['cache_path'];
}
elseif (!$data['cache_path'] && !empty($prev['cache_path']))
{
$path = $prev['cache_path'];
}
else
{
$path = JPATH_SITE . '/cache';
} |
|
Or even simpler if ($data['cache_path'])
{
$path = $data['cache_path'];
}
elseif (!empty($prev['cache_path']))
{
$path = $prev['cache_path'];
}
else
{
$path = JPATH_SITE . '/cache';
}I don't see the need for checking !$data['cache_path'] in else if block. |
|
I have tested this item ✅ successfully on b344bf3 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13612. |
|
thanks for helping, @joomdonation |
|
You're welcome @franz-wohlkoenig . If @infograf768 agree with my suggested changes, we will need your help re-test this PR again. |
|
will do. |
|
@franz-wohlkoenig @joomdonation Simplified as suggested, please test again. |
|
I have tested this item ✅ successfully on b069f82 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13612. |
|
@infograf768 Thanks for making the changes. I marked the test result. |
Maybe cause couldn't install todays nightly build ( |
|
Blank site? Before you press save or after pressing save? Maybe it is blank because you added die(); command? |
|
After pressing save. Maybe because of |
|
Yes. The die(); command is used to allow you to see notice before patch. After patch, you see blank screen means no notice anymore So for now, you should remove the die(); command, then save the configuration again. If configuration (especially cache path) is being saved, then you can mark the test result as success |
|
I have tested this item ✅ successfully on b069f82 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13612. |
|
@joomdonation haven't known that there's a beta1 and custom-path-update didn't work. After installing beta1 test was sccessfully. |
|
Sorry, I was wrong. The code looks OK |
|
@joomdonation |
|
RTC. Thanks. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13612. |
Pull Request for Issue #13608
When saving Global Configuration and
Path to Cache Folderis empty, we get a Notice in the PHP logs:[16-Jan-2017 16:07:25 UTC] PHP Notice: Undefined index: cache_path in /administrator/components/com_config/model/application.php on line 290This came from the merged PR #13520
Test before and after patch.
@mbabker