Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-10-25 12:03:10

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 605
Website

Prevents custom fields from refresh on publish/save

Hi, currently when you click on the publish or save buttons on the Write-page it refresh the custom fields DOM elements and remove any HTML modifications that has done to them, for example it removes the “bot_image_upload” plugin UI and returns the custom fields to normal.

Unlike the custom fields, the publish/save functions does not change the Title and Body fields HTML modifications, so this seems to happen only to the custom fields.

So I would like to know why is it like that, is it a bug or is it a feature, and how can I disable it in the code please?

Offline

#2 2021-10-25 12:11:02

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,191
Website

Re: Prevents custom fields from refresh on publish/save

Yes, the custom fields get refreshed by the async save and that can cause custom write panel plugins (especially older ones) to lose their place. If you reload the page (via the browser url bar), the layout should return to usual. I think this needs solving in “bot_image_upload”. I know I struggled with this with glz_custom_fields / bot_write_tab_customize and only partially resolved it.

BTW: you might want to look at com_article_image as a potential replacement for bot_image_upload.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2021-10-25 12:29:21

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 605
Website

Re: Prevents custom fields from refresh on publish/save

jakob wrote #331860:

I think this needs solving in “bot_image_upload”.

Thank you, is there a callback function that I can listen to and then refresh the plugin or even the whole page please?

Offline

#4 2021-10-25 19:12:55

etc
Developer
Registered: 2010-11-11
Posts: 4,549
Website GitHub

Re: Prevents custom fields from refresh on publish/save

THE BLUE DRAGON wrote #331861:

Thank you, is there a callback function that I can listen to and then refresh the plugin or even the whole page please?

Hi,

no warranty, but you can try to inject the following code on the admin side:

register_callback(function() {
    global $app_mode;
    $app_mode = null;
}, 'article', '', 1);

Offline

Board footer

Powered by FluxBB