×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Fatal error: Cannot declare class - Joomla 3.7
Søren Beck Jensen
Administrator
Posts: 73
7 lata 6 miesiąc temu #1575
przez Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Replied by Søren Beck Jensen on topic Fatal error: Cannot declare class - Joomla 3.7
Thank you for that update. I think what happened was that your component was built using Component Creator before we added the auto loader (that now broke). If that is the case, you may have to include it yourself as described.
Søren Beck Jensen
Founder, Component-Creator.com
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Gosling Cools
Junior Member
Posts: 20
7 lata 6 miesiąc temu #1576
przez Gosling Cools
Replied by Gosling Cools on topic Fatal error: Cannot declare class - Joomla 3.7
I want 3 beers as well!
Za tę wiadomość podziękował(a): Søren Beck Jensen
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Carl Willingham
New Member
Posts: 3
7 lata 6 miesiąc temu - 7 lata 6 miesiąc temu #1577
przez Carl Willingham
Replied by Carl Willingham on topic Fatal error: Cannot declare class - Joomla 3.7
N.A.
Ostatnia7 lata 6 miesiąc temu edycja: Carl Willingham od. Powód: Found the issue
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Randy Carey
Junior Member
Posts: 23
7 lata 6 miesiąc temu - 7 lata 6 miesiąc temu #1578
przez Randy Carey
I see that core has named its admin helper class differently, of this pattern: ExampleHelper instead of ExampleHelperExample or ExampleHelperExampleadmin.
Further, I discovered a new dependency upon this naming pattern for this class. In order to add the new custom fields feature to a component, a plugin expects a component's admin helper class to have certain functions available to it, and it expects that helper class to follow the naming pattern: ExampleHelper. I discovered this when trying to add the new custom fields feature to an extension that I newly created with ComponentCreator. I was able to get the new feature to work (within the CC-created extension) by creating the needed helper class (ExampleHelper), adding the new functions used by custom fields, and having it extend the CC-created helper class (ExampleHelperExampleadmin).
I do not know all the details that led CC to choose the solution it did (ExampleHelperExampleadmin), but from what I'm seeing, this file/class name seems to stray from the "core" approach, and I suspect it will cause problems should anyone want to add the custom fields feature to a CC-created component. I may be wrong, and if so, please correct me. But I do want to give you a "heads up" to what I think I'm seeing.
Replied by Randy Carey on topic Fatal error: Cannot declare class - Joomla 3.7
Joomla 3.7 introduced a new check that prevents two classes to have the same name (even though the documentation still says the two should be named the same way)Can you please tell us which change in Joomla 3.7 caused this and any other compatibility break?
I see that core has named its admin helper class differently, of this pattern: ExampleHelper instead of ExampleHelperExample or ExampleHelperExampleadmin.
Further, I discovered a new dependency upon this naming pattern for this class. In order to add the new custom fields feature to a component, a plugin expects a component's admin helper class to have certain functions available to it, and it expects that helper class to follow the naming pattern: ExampleHelper. I discovered this when trying to add the new custom fields feature to an extension that I newly created with ComponentCreator. I was able to get the new feature to work (within the CC-created extension) by creating the needed helper class (ExampleHelper), adding the new functions used by custom fields, and having it extend the CC-created helper class (ExampleHelperExampleadmin).
I do not know all the details that led CC to choose the solution it did (ExampleHelperExampleadmin), but from what I'm seeing, this file/class name seems to stray from the "core" approach, and I suspect it will cause problems should anyone want to add the custom fields feature to a CC-created component. I may be wrong, and if so, please correct me. But I do want to give you a "heads up" to what I think I'm seeing.
Ostatnia7 lata 6 miesiąc temu edycja: Randy Carey od.
Za tę wiadomość podziękował(a): Søren Beck Jensen
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Søren Beck Jensen
Administrator
Posts: 73
7 lata 6 miesiąc temu #1579
przez Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Replied by Søren Beck Jensen on topic Fatal error: Cannot declare class - Joomla 3.7
That is some good investigation there. We are looking into it. It is strange as "ExampleHelper" does not follow the standard Joomla naming convention for the JLoader and so custom fields have implemented this incorrectly it seems. But as I said... let us investigate this properly and get back to you.
Good work!
Good work!
Søren Beck Jensen
Founder, Component-Creator.com
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Søren Beck Jensen
Administrator
Posts: 73
7 lata 6 miesiąc temu - 7 lata 6 miesiąc temu #1581
przez Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Replied by Søren Beck Jensen on topic Fatal error: Cannot declare class - Joomla 3.7
Using only "ExampleHelper" breaks the auto loader functionality in Joomla so we recommend instead to add the lines:
To the bottom of your helper file if you are using custom fields.
// Ensure custom fields compatibility
class ExampleHelper extends ExampleHelpersExampleadmin {}
To the bottom of your helper file if you are using custom fields.
Søren Beck Jensen
Founder, Component-Creator.com
Ostatnia7 lata 6 miesiąc temu edycja: Søren Beck Jensen od.
Proszę Zaloguj lub Zarejestruj się, aby dołączyć do konwersacji.
Czas generowania strony: 0.058 s.