PHP Error - Undefined property: SimplecalendarTableEvent::$recur_end_after

  • imanickam
  • imanickam's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 3 weeks ago #951 by imanickam
imanickam created the topic: PHP Error - Undefined property: SimplecalendarTableEvent::$recur_end_after
Thanks for the nice and useful Joomla extension.

I want to bring to your attention a possible improvement to the existing version of the extension.

Test Environment:
- Operating System: Windows 10 64 bit
- WAMP Server v3.0.9
- Apache v2.4.25
- PHP v7.0.20
- MySQL Database v5.7.17

Installed Simple Calendar v3.1.9 that was released on June 30, 2017 (on Joomla! 3.7.3) and working with it.

Whenever a new event is added, noticed the following error in the PHP error log that results in stack overflow.

--- Error: Begin ---
[22-Jul-2017 02:50:32 UTC] PHP Notice: Undefined property: SimplecalendarTableEvent::$recur_end_after in C:\wamp64\www\joomla_37_3_ml\administrator\components\com_simplecalendar\tables\event.php on line 227

[22-Jul-2017 02:50:32 UTC] PHP Stack trace:
[22-Jul-2017 02:50:32 UTC] PHP 1. {main}() C:\wamp64\www\joomla_37_3_ml\administrator\index.php:0
[22-Jul-2017 02:50:32 UTC] PHP 2. JApplicationAdministrator->execute() C:\wamp64\www\joomla_37_3_ml\administrator\index.php:51
[22-Jul-2017 02:50:32 UTC] PHP 3. JApplicationAdministrator->doExecute() C:\wamp64\www\joomla_37_3_ml\libraries\cms\application\cms.php:265
[22-Jul-2017 02:50:32 UTC] PHP 4. JApplicationAdministrator->dispatch() C:\wamp64\www\joomla_37_3_ml\libraries\cms\application\administrator.php:156
[22-Jul-2017 02:50:32 UTC] PHP 5. JComponentHelper::renderComponent() C:\wamp64\www\joomla_37_3_ml\libraries\cms\application\administrator.php:98
[22-Jul-2017 02:50:32 UTC] PHP 6. JComponentHelper::executeComponent() C:\wamp64\www\joomla_37_3_ml\libraries\cms\component\helper.php:364
[22-Jul-2017 02:50:32 UTC] PHP 7. require_once() C:\wamp64\www\joomla_37_3_ml\libraries\cms\component\helper.php:389
[22-Jul-2017 02:50:32 UTC] PHP 8. SimplecalendarControllerEvent->execute() C:\wamp64\www\joomla_37_3_ml\administrator\components\com_simplecalendar\simplecalendar.php:34
[22-Jul-2017 02:50:32 UTC] PHP 9. SimplecalendarControllerEvent->save() C:\wamp64\www\joomla_37_3_ml\libraries\legacy\controller\legacy.php:709
[22-Jul-2017 02:50:32 UTC] PHP 10. SimplecalendarModelEvent->save() C:\wamp64\www\joomla_37_3_ml\libraries\legacy\controller\form.php:744
[22-Jul-2017 02:50:32 UTC] PHP 11. SimplecalendarTableEvent->store() C:\wamp64\www\joomla_37_3_ml\libraries\legacy\model\admin.php:1191
--- Error: End ---

Analysis of the problem revealed that the table #__simple calendar is missing two columns namely recur_every and recur_end_after. These colums were defined in v3.1.5 (souce - 3.1.5.sql) as shown below.

--- SQL: Begin ---
ALTER TABLE `#__simplecalendar` ADD `recur_every` INT NOT NULL DEFAULT '0', ADD `recur_end_after` INT NOT NULL DEFAULT '0';
--- SQL: End ---

Once these columns are created in the table, the error does not appear.

Post Analysis - Food for thought:

Situation: The options End Date and Reserve Date are not filled. So, they have the value 0000-00-00 in the columns.

(a) The columns could be added in the table ONLY WHEN there are NO ROWS in the table #__simplecalendar. If there are rows in this table, the ALTER TABLE SQL statement will FAIL. The failure is due to the value '0000-00-00' in the date columns. So, when the component was upgraded in an existing site, this SQL statment (found in 3.1.5.sql) may not have been executed successfully.

(b) The behavior described in (a) may very well be applied to other database schema changes such as MODIFYing the column datatype (as found in 3.1.0 SQL)

Kindly look into the missing column names and schema changes logic.

Thanks.

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #954 by admin
admin replied the topic: PHP Error - Undefined property: SimplecalendarTableEvent::$recur_end_after
Thanks - notices should be hidden on a productive Joomla site but thanks for the heads up - will fix it for the next version.
Fabrizio

Please Log in or Create an account to join the conversation.

  • imanickam
  • imanickam's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 months 3 weeks ago #955 by imanickam
imanickam replied the topic: PHP Error - Undefined property: SimplecalendarTableEvent::$recur_end_after
Thanks for taking care of this. Yes, in the live site, we have set the Error Reporting to none. I always check the php log for any anomalies and noticed this.

Please Log in or Create an account to join the conversation.

Time to create page: 0.279 seconds
Powered by Kunena Forum