- CAS Version
- 2.3.11
- XenForo Version
- 2.3.13
- PHP Version
- 8.2
- Database & Version
- Maria DB 10
- Are there any errors being throw?
- Yes
Bob, this is from AI diagnosing a xenforo server error. If this is slop please delete. The warning error is very infrequent. It suggested I "draft a bug report for Bob". 
---------------------------
I encountered this error on TalkBass running CAS 2.3.11:
Template error: [E_USER_WARNING] Method getAdTypePhrase is not callable on the given object (XenAddons\CAS\Entity\Comment)
The stack trace shows it occurring during login, when CAS completes a pre-registration comment action and attempts to send the success push notification.
In push_cas_comment_pre_reg, the phrase parameters currently contain:
'ad_type': $content.getAdTypePhrase(),
'title': prefix('cas_ad', $content.Ad, 'plain') . $content.Ad.title
Since $content is a Comment entity, it looks like the ad type should also be retrieved through its Ad relation:
'ad_type': $content.Ad.getAdTypePhrase(),
Relevant stack frames:
XF\Template\Templater->method(
Object(XenAddons\CAS\Entity\Comment),
'getAdTypePhrase',
Array
)
public/push_cas_comment_pre_reg.php(8)
XenAddons\CAS\PreRegAction\AbstractCommentHandler->sendSuccessAlert(...)
Could you confirm whether that is the correct fix and include it in a future maintenance release? The proposed correction hasn’t yet been verified by reproducing the notification flow.
Thanks!
---------------------------
I encountered this error on TalkBass running CAS 2.3.11:
Template error: [E_USER_WARNING] Method getAdTypePhrase is not callable on the given object (XenAddons\CAS\Entity\Comment)
The stack trace shows it occurring during login, when CAS completes a pre-registration comment action and attempts to send the success push notification.
In push_cas_comment_pre_reg, the phrase parameters currently contain:
'ad_type': $content.getAdTypePhrase(),
'title': prefix('cas_ad', $content.Ad, 'plain') . $content.Ad.title
Since $content is a Comment entity, it looks like the ad type should also be retrieved through its Ad relation:
'ad_type': $content.Ad.getAdTypePhrase(),
Relevant stack frames:
XF\Template\Templater->method(
Object(XenAddons\CAS\Entity\Comment),
'getAdTypePhrase',
Array
)
public/push_cas_comment_pre_reg.php(8)
XenAddons\CAS\PreRegAction\AbstractCommentHandler->sendSuccessAlert(...)
Could you confirm whether that is the correct fix and include it in a future maintenance release? The proposed correction hasn’t yet been verified by reproducing the notification flow.
Thanks!