• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Fixed CAS 2.3.11: push_cas_comment_pre_reg calls getAdTypePhrase() on Comment entity

kontrabass

Member
AMS Premium
CAS Premium
RMS Premium
SC Premium
TS Premium
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". :LOL:

---------------------------
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!
 
  • Like
Reactions: Bob
Ya, its a legit bug and fixed in CAS 2.3.12

You can fix on your own in the mean time...

Template: push_cas_comment_pre_reg

Find: 'ad_type': $content.getAdTypePhrase(),

Replace with: 'ad_type': $content.Ad.getAdTypePhrase(),
 
Back
Top