Undefined index: Message

11 years 1 month ago - 11 years 1 month ago #223471 by fancypants
Undefined index: Message was created by fancypants
I had the free version of CB installed on a site I'm developing and kept receiving the following message anytime I clicked on a CB link:

Notice: Undefined index: view in <span>/</span>home<span>/</span>content/36/8718036/html/DOMAINS/xxxxxxxxx/components/com_content/router.php on line 48

I upgraded to the paid version hoping this would solve the problem, but no such luck.

Turning off SEF fixes the problem, but that's not a good solution for me.

I also noticed that deleting the router.php file from the path above also fixes the problem, but that's probably not a good idea.

The rest of my site works great -- CB is the only aspect that experiences this problem. I've seen several threads on the internet with people having the same message related to CB. Aside from turning off SEF or turning off error reporting, there are no real solutions.

Can anyone help with this?

BTW... Below is the code from the Router file in question. You'll notice that it pertains to section ID, etc. which is where the SEF comes into play. I've also seen a few threads that discuss issues with the itemID.

// are we dealing with an article or category that is attached to a menu item?
if (($menuItem instanceof stdClass) && $menuItem->query == $query && isset($query) && $menuItem->query == intval($query)) {
unset($query);

if (isset($query)) {
unset($query);
}

if (isset($query)) {
unset($query);
}

unset($query);

return $segments;
}

if ($view == 'category' || $view == 'article')
{
if (!$menuItemGiven) {
$segments[] = $view;
}

unset($query);

if ($view == 'article') {
if (isset($query) && isset($query) && $query) {
$catid = $query;

Please Log in to join the conversation.

11 years 1 month ago #223540 by fancypants
Replied by fancypants on topic Undefined index: Message
:cheer:
Along with CB I also use jreviews on my site. You've got to love the jreviews guys... they sent me some code to replace in the router file and everything works perfectly now with the CB links -- no more Notice: Undefined index: view in /home/content/36/8718036/html/DOMAINS/xxxxxxx/components/com_content/router.php on line 48.

In the router.php file indicated above, simply replace:

if (($menuItem instanceof stdClass) && $menuItem->query == $query && isset($query) && $menuItem->query == intval($query)) {

with:

if (($menuItem instanceof stdClass) && isset($menuItem->query) && isset($query) && $menuItem->query == $query && isset($query) && $menuItem->query == intval($query)) {

It worked great for me. Thanks to Alejandro and reviewsforjoomla!!!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.172 seconds

Facebook Twitter LinkedIn