01487: Custom GUI edit buttons duplicating

Summary: Custom GUI edit buttons duplicating
Created: 2022-12-19 10:30
Status: Closed, replied
Category: Cookbook
From: ykaly?
Assigned:
Priority: 2
Version: 2.3.16
OS: RHEL 8 / HTTPD / PHP 7.2.24

Description: Apologies in advance if this is not the correct medium to make this topic.

I am copying a custom gui edit button cookbook that was used on pmwiki-2.2.0 with PHP5. When I try to use it on a pmwiki-2.3.16 with PHP7, the gui edit buttons appear but it is duplicating.

I am not really knowledgeable on PHP scripts and did my research to fix it but my attempts all fails..I would really appreciate if someone can hint me on where the possible problem is, then I will make my research and try to fix it.

Attach:ykalycookbook.php ykaly?

There is really no problem, no need to apologize, this is the correct place to ask.

Here is your file updated for recent PmWiki and PHP versions: Attach:ykaly-buttons.php.

If you don't have it in config.php, add this line: $EnableGUIButtons = 1; (I suspect you already have it).

The buttons appeared twice because your cookbook script included the core guiedit.js, and PmWiki also included it, so it got loaded twice.

I have updated your recipe to work with PHP up to 8.2 (removed older insert functions), and with the latest PmWiki (some escaped characters needed to be updated).

Let me know if you find some bug/omission, or if you need additional assistance. --Petko

Thank you so much. This solves my problem :) --ykaly?