I'm using adaptive theme with the pixture reloaded project. I updated adaptive theme and then I have this following error message:

Notice : Undefined index: #original_link in adaptivetheme_menu_link() (ligne 115 in ./www/sites/all/themes/adaptivetheme/adaptivetheme/inc/template.theme.inc)

Thanks

CommentFileSizeAuthor
#5 template.theme_.zip2.08 KBJeff Burnz

Comments

Jeff Burnz’s picture

Category: bug » support
Priority: Major » Normal

Did you update anything else?

Clear the cache (specifically the menu cache) and see if the problem persists.

DrRaph’s picture

Thanks for you to reply so quickly.

It was my only update and in fact I did clear the cache several times, with unsuccess

phoenixf’s picture

I have had the same issue. Though I did update some of my modules. I did not pay as close attention as I should. (learning lesson 12, pay more attention to updates) I think I recall updating the modules, Views and one other.

Under reports, one of my pages is causing this. I deleted the page and I am still receiving this error.

stevebab’s picture

Same issue here, only with Basic theme. I updated Views, Date and several others this morning.

Also, cache is totally disabled, still get the errors.

Jeff Burnz’s picture

Category: support » bug
StatusFileSize
new2.08 KB

This is weird that #original_link is undefined, the theme just has nothing to do with this and is not really changing how its used, merely getting more data out of it and using it to set a class.

You can test this two ways:

1) go into the theme settings and look for the "CSS Classes" tab, and uncheck "Menus", see if the issue fixes itself (this is just a test, please report back), or...

2) take the attached file and replace adaptivetheme/adaptivetheme/inc/template.theme.inc with it (its the same file with a mod). Please do not do this on a live site, and backup the original first. All this does it put a few checks around #original_link. Remember to unzip it first!

Jeff Burnz’s picture

One of my commercial clients ran into this, with debugging it was found to be Nice Menus 7.2.1 update from 7.2.0.

brambleworks’s picture

Yup, it's the new version of Nice Menus. Reinstalling Nice Menus 7.x-2.0 solved the problem for me. Go here to get it: http://drupal.org/node/43047/release

Anonymous’s picture

Yep! Same news here. Rolled back Nice menus, cleared cache and now all is well.

Thanks for posting!

TJM’s picture

Below is what I found necessary to do to allow me to upgrade Nice_menus from 7.x-2.0 to 7.x-2.1 on a local development site. It appears that uninstalling Nice Menus 7.x-2.0 leaves data behind that causes error messages. So I found it necessary to delete the old nice menus data in the table variable before updating the nice_menus module for the Adaptivetheme. Before updating, it is helpful to make a note of all the block configuration settings for your nice menus. Also, realize that the new version of nice menus has a number of new changes that will require modifications to your css files.

Drupal 7.12
Adaptivetheme 7.x-2.2
Nice_menus from 7.x-2.0 to 7.x-2.1

As standard practice, do a backup of your data in case the procedure does not work with your install.
1. disable nice menus module
2. uninstall nice menus module
3. Using phpMyAdmin, Click on Search tab and type the letters: nice_menus
5 Click: Select All
6. Click: Go
7. You will notice there are a number of instances of nice_menus, but ignore these and look down the list and find the phrase: match(es) inside table variable Browse Delete
8. Click: Delete
9. Download nice_menus-7.x-2.1.tar.gz from the drupal.org web site.
10. From your local development site, delete the nice_menus module from sites/all/modules folder.
11. Uncompress nice_menus-7.x-2.1.tar.gz and copy the nice menus 2.1 version to sites/all/modules folder.
12. Flush the cache
13. List modules and click on the checkbox to activate the updated nice_menus module
14. Configure the Nice menus: Configuration-->User Interface-->Nice menus
14. Structure -->Blocks-->activate blocks
15. Configure each nice menu block. It is helpful if you write down the block configurations or have a non-development site to re-enter the configuration information for each of the new version of nice menus blocks.
16. You will need to modify your css file because of the changes to the new version of the nice_menu 2.1 module.

EPO’s picture

Component: AT Core » CSS/HTML

The suggestion of #9 didn't work for me so injected the missing #original_link the Drupal way in the template.php of my subtheme.

function <hook>_preprocess_menu_link(array &$vars) {
    // nice-menus setzen keinen #original_link
    // das führt aber bei adaptivetheme zu einer Fehlermeldung
    // adaptivtheme benötigt nur die mlid, deshalb wird nicht das gesamte 
    // #original_link array nachgebaut. (vgl menu.inc 1067 und davor)
    if(!isset($vars['element']['#original_link'])){
        $mlid = str_ireplace('menu-','',$vars['element']['#attributes']['class'][0]);
        $vars['element']['#original_link']['mlid']=$mlid;
    }
}

<hook> has to be replaced by the name of the subtheme or by a module name of your own. You have to visit the theme administration page and to clear the cache to make this function work.

EPO’s picture

Nota bene: the <hook> replaced with a module name wasn't working in first instance. After violently executing

drupal_flush_all_caches();
drupal_theme_rebuild();

the theme registry updated properly.

Jeff Burnz’s picture

In case anyone is wondering what the comments in German say, this is Google translation:

// Nice-menus does not # set original_link
// This leads to adaptive theme in an error message
// Adaptivtheme requires only the MLID, therefore, not the entire
// # Original_link array rebuilt. (see menu.inc 1067 and before)

Reading this comment makes me think we should check for the original link, it would at least overcome this issue, although really Nice Menus needs to fix this. Right now it only checks if its not empty, but it needs to check if its set in adaptivetheme_menu_link():

isset($element['#original_link'])

The fix in #10 is good, setting it back in like that is quite smart, could also add that to the the theme as a workaround.

SusieQ123’s picture

Just wandered if anyone experienced the same error type message referring to the view.tpl.php
Thanks
Sue

www.redboxlingerie.com

Jeff Burnz’s picture

Category: bug » support
Status: Active » Closed (fixed)

The fix is provided in #10 for those running into such issues, since this is not a theme issue and appears to be entirely related to Nice Menus I am closing and moving to support request.

This is not something I think we need to provide for in the base theme, themes should be able to override standard theme function overrides without having to hack in workarounds to support failing/broken modules.

Thank-you EPO for providing this fix.

beczesz’s picture

Indeed, #10 helped me too
thx

viktor.mastoridis’s picture

#5 solved it for me, thanks

brianlp’s picture

#5 (2) worked for me. Thanks.

yasheshb’s picture

#10 work for me too. thanks EPO

i'm using Nice Menus - 7.x-2.1 and Sky Theme - 7.x-2.3

shaneonabike’s picture

Status: Closed (fixed) » Active

Sorry to re-open this issue but I'm now having this problem with Dynamic Persistent Menus. Seems like some bigger theme related issue as it's not clear to me why it would happen with both modules?

Am I wrong here.... if we could fix this that would be great... I tried the fix in #10 with no dice unfortunately.

shaneonabike’s picture

Status: Active » Closed (fixed)

Sorry I just realized that my issue is a bit different and strange I'll report it elsewhere

hendrohwibowo’s picture

#10 work for me too. thanks a lot

i'm using Nice Menus - 7.x-2.1 and corolla-7.x-2.0

batigolix’s picture