PlgEditors-xtd - class name problem #812
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#812
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Discussed in https://github.com/vdm-io/Joomla-Component-Builder/discussions/809
Originally posted by linpi1 September 29, 2021
I want to create an button as an editor extension. In the php file, the default class name of the plugin starts with PlgEditors-xtd + the plugin name, example class PlgEditors-xtdBookshopButton extends CMSPlugin. This dash in the class name makes an error in PHPStorm and also when I open an article:
syntax error, unexpected '-', expecting '{'
Therefore I changed the class name to PlgEditors_xtdBookshopButton. No error anymore.
But I cant not just change it with
/***[REPLACE<>$$$$]***/
this make a compilation warning:Custom Code Warning File plugin_editors-xtd_bookshopbutton/bookshopbutton.php could not be found, so the custom code for this file could not be addded.
So what to do know?
Another thing, the expected button doesn't appear in the editor. I compared the code (function onDisplay($name)) with editor-xtd/article.php and it is almost the same, but still no button. Is there something missing to add ?
for a editor extension, the class has always to be:
PlgButton{PluginName}
example: name of the plugin: BookshopButton
what JCB produce:
class PlgEditors-xtdBookshopButton extends CMSPlugin
what it should produce:
class PlgButtonBookshopButton extends CMSPlugin
@linpi1 if you get a moment please check the code from
d57f35fc00
if it resolve the issue.I have now update the staging branch with these new changes... please will you also test that?
Okay this issue has been resolved far as I can tell.