Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-06-24 02:38:13

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Not calling back anymore - was it something I said?

Has anything happened recently to the way callbacks are set up/operate?

Consider this test code:

register_callback('test_cb', 'article_saved');

function test_cb($event, $step, $rs) {
	trigger_error("**** $event ****");
}

This should generate a User_Notice dialog in the browser.

Works quite happily … until TXP 4.8.4. Seeing same issue with other callbacks – ‘page_saved’, ‘form_saved’ etc.

Offline

#2 2021-06-24 06:40:16

etc
Developer
Registered: 2010-11-11
Posts: 5,235
Website GitHub

Re: Not calling back anymore - was it something I said?

Hi Adi. This code is working for me, I get

User_Notice "**** article_saved ****"
in C:\xampp\htdocs\textpattern\textpattern\plugins\abc_test.php at line 5.
adminErrorHandler()
C:\xampp\htdocs\textpattern\textpattern\plugins\abc_test.php:5 trigger_error()
C:\xampp\htdocs\textpattern\textpattern\lib\txplib_misc.php:1589 test_cb()
C:\xampp\htdocs\textpattern\textpattern\include\txp_article.php:352 callback_event()
C:\xampp\htdocs\textpattern\textpattern\include\txp_article.php:116 article_save()
C:\xampp\htdocs\textpattern\textpattern\index.php:228 include()

Are you omitting some details? The plugin should be of Admin+AJAX type, just in case.

There were some changes in the callbacks storage, but they are post-4.8.4, iirc.

Offline

#3 2021-06-24 06:55:00

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Not calling back anymore - was it something I said?

etc wrote #330643:

The plugin should be of Admin+AJAX type, just in case.

There were some changes in the callbacks storage, but they are post-4.8.4, iirc.

That did the trick! Thanks very much.

Offline

Board footer

Powered by FluxBB