View "sermon".Attempt to assign property "statisticTotal" on bool #36

Closed
opened 2024-02-09 10:04:34 +00:00 by phlambotte · 6 comments

Hello,

I have installed Server distributor from https://extensions.joomla.org/extension/living/religion/sermon-distributor/

A problem occurs in the frontend, for displaying a sermon of a preacher.
Activating "joomla console debug, says :

0 Attempt to assign property "statisticTotal" on bool
/components/com_sermondistributor/models/sermon.php:220

Investigating in the file sermon.php, the problem comes from the lines #130 and #131:
there is a field "not_required" wich is not in the table "#__sermondistributor_sermon" structure

array('a.id','a.asset_id','a.name','a.alias','a.preacher','a.short_description','a.icon','a.scripture','a.series','a.catid','a.description','a.link_type','a.source','a.build','a.manual_files','a.local_files','a.url','a.not_required','a.auto_sermons','a.published','a.created_by','a.modified_by','a.created','a.modified','a.version','a.hits','a.ordering','a.metadesc','a.metakey','a.metadata'),

array('id','asset_id','name','alias','preacher','short_description','icon','scripture','series','catid','description','link_type','source','build','manual_files','local_files','url','not_required','auto_sermons','published','created_by','modified_by','created','modified','version','hits','ordering','metadesc','metakey','metadata')));

Proposed modification:

If the table's "__sermondistributor_sermon" field "not_required" comes from older version and it is not used anymore, remove the field "a.not_required" in file /components/com_sermondistributor/models/sermon.php,update the lines #130 and #131.

Also, because this component seems to be created from "JCB" component, (via import JCB packages), should modify the "dynamic gets" sermon, in the field "selection" removing the field "not_required"

Hope this helps,sorry for my poor english, I never use git before, hope to learn how this works ;-)

Hello, I have installed Server distributor from https://extensions.joomla.org/extension/living/religion/sermon-distributor/ A problem occurs in the frontend, for displaying a sermon of a preacher. Activating "joomla console debug, says : > 0 Attempt to assign property "statisticTotal" on bool > /components/com_sermondistributor/models/sermon.php:220 Investigating in the file sermon.php, the problem comes from the lines #130 and #131: there is a field "not_required" wich is not in the table "#__sermondistributor_sermon" structure > array('a.id','a.asset_id','a.name','a.alias','a.preacher','a.short_description','a.icon','a.scripture','a.series','a.catid','a.description','a.link_type','a.source','a.build','a.manual_files','a.local_files','a.url','**a.not_required**','a.auto_sermons','a.published','a.created_by','a.modified_by','a.created','a.modified','a.version','a.hits','a.ordering','a.metadesc','a.metakey','a.metadata'), > array('id','asset_id','name','alias','preacher','short_description','icon','scripture','series','catid','description','link_type','source','build','manual_files','local_files','url','**not_required**','auto_sermons','published','created_by','modified_by','created','modified','version','hits','ordering','metadesc','metakey','metadata'))); Proposed modification: If the table's "__sermondistributor_sermon" field "not_required" comes from older version and it is not used anymore, remove the field "a.not_required" in file /components/com_sermondistributor/models/sermon.php,update the lines #130 and #131. Also, because this component seems to be created from "JCB" component, (via import JCB packages), should modify the "dynamic gets" sermon, in the field "selection" removing the field "not_required" Hope this helps,sorry for my poor english, I never use git before, hope to learn how this works ;-)
Owner

On which version of Joomla did you install SD? and which version of SD?

On which version of Joomla did you install SD? and which version of SD?
Author

Hello Llewellyn,

the joomla version : 3.10.12
the sd version : 2.1.1
php version : 8.1
mysql version : 8.0.36
tested on Ubuntu 22.04.3 LTS

The component was dowloaded from Joomla :

(I just recheck, and download it again from https://extensions.joomla.org/extension/sermon-distributor/, unzip the package, and unzip christian__Joomla-Sermon-Distributor__master,
The bug may be in file pkg-sermondistributor-master/pkg-sermondistributor/src/christian__Joomla-Sermon-Distributor__master/joomla-sermon-distributor/site/models/sermon.php, lines #130 and #131, because of the table "'#__sermondistributor_sermon" does not have "not_required" column

I suspect that this crashes the sql query line 160, and then the catch line 202 gives a value for $data equal to "false" (line 212)
Then the line 220, $data being equal to false, necessarily the script crashes

I hope this helps.

Hello Llewellyn, the joomla version : 3.10.12 the sd version : 2.1.1 php version : 8.1 mysql version : 8.0.36 tested on Ubuntu 22.04.3 LTS The component was dowloaded from Joomla : (I just recheck, and download it again from https://extensions.joomla.org/extension/sermon-distributor/, unzip the package, and unzip christian__Joomla-Sermon-Distributor__master, The bug may be in file pkg-sermondistributor-master/pkg-sermondistributor/src/christian__Joomla-Sermon-Distributor__master/joomla-sermon-distributor/site/models/sermon.php, lines #130 and #131, because of the table "'#__sermondistributor_sermon" does not have "not_required" column I suspect that this crashes the sql query line 160, and then the catch line 202 gives a value for $data equal to "false" (line 212) Then the line 220, $data being equal to false, necessarily the script crashes I hope this helps.
Owner

But is it resolved now?

But is it resolved now?
Author

But is it resolved now?

It works on my joomla installation because I removed the "not_required" field, but on the "original" code (on https://extensions.joomla.org/extension/sermon-distributor/) , the problem persists.

Sorry, I realize now that I shouldn't have closed the ticket, this tool is new to me, thanks for your patience ;-)

> But is it resolved now? It works on my joomla installation because I removed the "not_required" field, but on the "original" code (on https://extensions.joomla.org/extension/sermon-distributor/) , the problem persists. Sorry, I realize now that I shouldn't have closed the ticket, this tool is new to me, thanks for your patience ;-)
Robot referenced this issue from a commit 2024-02-11 17:25:05 +00:00
Owner

You are very welcome :)

I have now updated the master branch... if you can test it and let me know that will be wonderful.

You are very welcome :) I have now updated the master branch... if you can test it and let me know that will be wonderful.
Author

Wonderful! It is working like a charm!
Have a nice day and thank you for your works ;-)

Wonderful! It is working like a charm! Have a nice day and thank you for your works ;-)
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: christian/Joomla-Sermon-Distributor#36
No description provided.