First of all, I am sorry for could not test my extensions with Joomla 3.6.0 before it was released.
After updating to Joomla 3.6.0, our customers reported this fatal error with my extension Events Booking
Fatal error: Cannot redeclare EventbookingBuildRoute() (previously declared in /home1/alamode1/public_html/components/com_eventbooking/router.php:16) in /home1/alamode1/public_html/components/com_eventbooking/router.php on line 16
Expected result
Everything works well as in Joomla 3.5.1
Fatal error as stated above
I haven't had a enough time to find out the root of the error yet. However, I think it is related to this PR #9541
1. My component use JLoader::registerPrefix method for auto-loading component classes
JLoader::registerPrefix('Eventbooking', JPATH_BASE . '/components/com_eventbooking');
For now, I fix the issue by changing component router code to use class
class EventbookingRouter extends JComponentRouterBase
{
public function build(&$query)
{
}
public function parse(&$segments)
{
}
}
Thanks Michael for your response. For my extensions, the only affected file is router.php, it is an easy and quick fix, so I am not worry about it. I just reported it here in case someone else has same issue could see the reason and can address it.
Honestly the only fix is reverting that pull request and removing the
ability to autoload files without being nested in a directory. Depends how
strongly people feel about it I guess.
On Tuesday, July 12, 2016, Tuan Pham Ngoc notifications@github.com wrote:
Thanks Michael for your response. For my extensions, the only affected
file is router.php, it is an easy and quick fix, so I am not worry about
it. I just reported it here in case someone else has same issue could see
the reason and can address it.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11088 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAWfoUcZpk6spkdMNXsy8sqt_NGPMX_Lks5qVGGFgaJpZM4JLCHb
.
I think it will only happens with components use JLoader::registerPrefix to autoload component's classes like in my case. Joomla core components don't use it (?), so hopefully, there are not many extensions get this issue
Lets leave this open for a few weeks in case anyone else reports it. If not then we can close this
Labels |
Added:
?
|
+1
+1
+1
3 so far today :)
I can confirm this issue loading duplicated routers.
The main issue is that router is checking things based in routers' class names:
https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/router/site.php#L717
That's checking if a class exists but old routers are based in functions so it tries to require the file.
Also the loader is using include
here:
https://github.com/joomla/joomla-cms/blob/staging/libraries/loader.php#L599
Switching that to include_once
fixed the issue here but I don't know if that can cause some side effects (In fact I think require_once
would be better there because if a class is not loaded a bigger issue will happen?)
So as I see it there are 2 possible solutions:
getComponentRouter()
require_once
include
in JLoader
to include_once
(or require_once
if you have time to fix further issues)Hi everyone. I can confirm the same issue as i was testing the Joomla 3.6 upgrade on my demo site:
Fatal error: Cannot redeclare EventbookingBuildRoute() (previously declared in /var/www/vhosts/demo.rwmbeta.com/public_html/components/com_eventbooking/router.php:16) in /var/www/vhosts/demo.rwmbeta.com/public_html/components/com_eventbooking/router.php on line 374
Category | ⇒ | Router / SEF |
Status | New | ⇒ | Confirmed |
Setting to needs review
Status | Confirmed | ⇒ | Needs Review |
That's probably the cause but I wouldn't consider it a backward
compatibility issueHonestly the only fix is reverting that pull request and removing the
ability to autoload files without being nested in a directory. Depends how
strongly people feel about it I guess.
I guess people dont feel strongly about it based on the activity - I strike to close this?
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-10-12 01:13:06 |
Closed_By | ⇒ | joomdonation |
Yes, we should close this issue. I had converted all of my extensions to use class base router, so it is no longer an issue anymore. Let's move forward!
On preview I get:
Cannot redeclare EventbookingBuildRoute() (previously declared in /home/franklinhighscho/public_html/components/com_eventbooking/router.php:16) in /home/franklinhighscho/public_html/components/com_eventbooking/router.php on line 357
Has there been a fix discovered? Thanks!
@nmemory Update your site to latest version of Events Booking and the error will be gone
If you could not afford to purchase latest version to update, submit a support ticket and we will help modifying the router file to get it works with latest version of Joomla
Thank you. I'm new here... where do I submit a support ticket?
Go to http://joomdonation.com/support-tickets.html to submit ticket (You need to register for an account on our website to submit ticket)
ok, thank you!
I submitted a ticket. What is the best way to get the response? Do I sit here and check where the ticket was posted or watch my email? The response time said 24 hours.
Again, thanks!
Asked you for more information via support ticket (there should be notification sent to you already). Please use our support tickets system to reply, don't submit more comment here.
Hi there,
This is what i get after updating joomla from 3.6.2 to 3.6.4:
Fatal error: Cannot redeclare EventbookingBuildRoute() (previously declared in /home/topvriendj/domains/wegenercoaching.nl/public_html/components/com_eventbooking/router.php:16) in /home/topvriendj/domains/wegenercoaching.nl/public_html/components/com_eventbooking/router.php on line 358
Who can help me...
Who can help me...
If you read the full thread in this issue, its full of things that can help you!
Update your site to latest version of Events Booking and the error will be gone
and
Go to http://joomdonation.com/support-tickets.html to submit ticket (You need to register for an account on our website to submit ticket)
Most probably you only need to update the component ... and you have your fix ...
I did try to update but it doesnt work ... :(
I did try to update but it doesnt work ... :(
Then you need to contact @joomdonation and seek support for their extension. Support for 3rd party extensions is not available in the Joomla CMS Issue tracker.
Go to http://joomdonation.com/support-tickets.html to submit ticket (You need to register for an account on our website to submit ticket)
BACKUP YOUR SITE then select the event booking items and click uninstalll
I did try to update but it doesnt work ... :(
A general comment about paid extensions , many have an update URL
ok, but the update URL, will not work without a subscription
i do not know more i do use this component
It is fixt, I did uninstall correctly and it works fine again!! Thank you all, I really appreciate you fast replays :)
That's probably the cause but I wouldn't consider it a backward
compatibility issue. It's indeed an unwanted side effect and it really
only works with the controller.php and router.php files because those would
possibly have a class matching a registered prefix to the autoloader; maybe
the component's entry point file too if you had some class like
EventbookingEventbooking.
On Tuesday, July 12, 2016, Tuan Pham Ngoc notifications@github.com wrote: