× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

Fatal error: Cannot declare class - Joomla 3.7

7 năm 1 ngày trước - 6 năm 11 tháng trước #1553 bởi Søren Beck Jensen
Fatal error: Cannot declare class - Joomla 3.7 was created by Søren Beck Jensen
Hi all,

We realize that Joomla 3.7 causes issues with components. We have already fixed Component Creator to work around this issue in Joomla so you can simply rebuild your component.

If you have made modifications to your component and can't just rebuild here is a solution to fix the issue manually.

If your component is called "com_example":
  1. Rename /administrator/com_example/helpers/example.php to exampleadmin.php
  2. Add the following string to the bottom of the file
    // Ensure custom fields compatibility
    class ExampleHelper extends ExampleHelpersExampleadmin {}
    Remember to rename "Example" with the name of your component.
  3. Perform a search and replace in the folder (and sub folders) /administrator/components/com_example/ Search for ExampleHelpersExample and replace with ExampleHelpersExampleadmin

It is important to ONLY perform the search and replace in the /administrator/com_example/ folder (and sub folders).

We are sorry for the inconvenience this Joomla issue may have caused you.

Søren Beck Jensen
Founder, Component-Creator.com
Last edit: 6 năm 11 tháng trước by Søren Beck Jensen. Lý do: Adding compatibility with custom fields
Những thành viên sau(s) đã Cảm ơn: Noxidsoft - Noel Dixon, George Taylor

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

7 năm 1 ngày trước #1562 bởi Janne Riihimäki
Replied by Janne Riihimäki on topic Fatal error: Cannot declare class - Joomla 3.7
Do you have idea if this issue will remain or be fixed in upcoming 3.7.1 for example?

Any other problems affecting component creator like these mentioned here: www.akeebabackup.com/home/news/1676-joom...and-cli-scripts.html

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

7 năm 1 ngày trước #1563 bởi Izhar Aazmi
Replied by Izhar Aazmi on topic Fatal error: Cannot declare class - Joomla 3.7
Hi Søren,

Can you please tell us which change in Joomla 3.7 caused this and any other compatibility break?

PS: I'd suggest to change the title of this page as the it causes to think for a moment as if something is broken here :)

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

7 năm 1 ngày trước #1564 bởi TechLabPro
Replied by TechLabPro on topic Fatal error: Cannot declare class - Joomla 3.7
Hello,

Please check detail page by enabling "Search Engine Friendly URLs"

Now issue is no data showing in detail page.

See my screenshot prntscr.com/f37ihf

Please fix this issue I submit support request last week but don't get any reply.

Thanks

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

7 năm 1 ngày trước - 7 năm 1 ngày trước #1565 bởi Gosling Cools
Replied by Gosling Cools on topic Fatal error: Cannot declare class - Joomla 3.7
H Soren,

What if I upgraded Joomla to 3.7 and the custom components are NOT showing that Fatal error?
I have many sites with JCC all upgraded to Joomla 3.7, but not seen this Fatal error yet.
Even while Error Reporting is set to Development.

And should you not rename that file in the view.html.php files?
protected function addToolbar() {
        require_once JPATH_COMPONENT . '/helpers/example.php';

to
  require_once JPATH_COMPONENT . '/helpers/exampleadmin.php';
And only change the classname once in exampleadmin.php from ExampleHelpersExample to ExampleHelpersExampleadmin

Can you explain that? Or am I using very old JCC code?

Regards,

Gosling
Last edit: 7 năm 1 ngày trước by Gosling Cools.

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

7 năm 1 ngày trước #1567 bởi Cesar Campo
Replied by Cesar Campo on topic Fatal error: Cannot declare class - Joomla 3.7
I was not getting that error, I renamed the helper file anyway (step 1),
now on step 2 there's a note that says "It is important to ONLY perform the search and replace in the /administrator/com_example/ folder" if I do that I'm not getting any search results, but if I do recursive search starting with that folder it returns several hits.
So, I just want to confirm the search is not recursive right ? Maybe that's the reason I'm not affected by this ?

Thanks,

Cesar

Vui lòng Đăng nhập hoặc Tạo tài khoản để tham gia cuộc hội thoại.

Thời gian tải trang: 2.419 giây
Powered by Kunena Forum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.