On my Drupal 7 site, I'm periodically receiving the following message, sometimes on pages themselves, sometimes on the admin screens.

I think it's only happening for me, when I'm logged in - checking on other computers without being logged in doesn't seem to be a problem - but I certainly don't want regular users seeing this message.

Everything seems to be operating normally.

Any ideas of what this means and how I can fix it would be greatly appreciated.

Notice: Undefined variable: field_view_mode in include() (line 11 of /home/votel970/public_html/sites/all/themes/adaptivetheme/lesliewallace/templates/field--image.tpl.php).
Notice: Undefined variable: field_view_mode in include() (line 16 of /home/votel970/public_html/sites/all/themes/adaptivetheme/lesliewallace/templates/field--image.tpl.php).

Comments

vm’s picture

The error is being thrown by the adaptive theme base theme folder. Are you using a subtheme? Is lesliewallace the subtheme? Any reason why it's living in the adaptive theme folder and not outside of it?

What version of adaptive theme is in use?

It's upset about a tpl.php file. Have you checked the issue queue of the theme in question for similar reports? Jeff and company is pretty quick to response to issues posted in the queue.

saltspringer’s picture

Yes, lesliewallace is a subtheme - should it not be in the adaptive theme folder?

The version is adaptivetheme-7x-2x

No, I haven't checked the issue queue - I'll do that now.

Thanks for responding.

vm’s picture

I don't know what impact having the subtheme inside the theme folder would be. My subthemes live outside the base theme. if using the -dev version (I can't discern 7.x-2.x and whether you are using a stable release or not) then you may have to use the stable version.

saltspringer’s picture

Just tried moving it out, but it broke it - probably because the CSS path was wrong - I'm making a copy with that corrected now.

And yes, I see that there's an update to that theme (the 'Corolla' theme of adaptivethemes) so I'll see if that helps.

vm’s picture

after moving the folder, clear the theme registry by clearing he cache which should rescan the theme folder and relocate the theme properly.

saltspringer’s picture

Oh, thanks for that tip - I'll try it.

saltspringer’s picture

Moved it up a level, revised the CSS accordingly, cleared the cache as you suggested, and it all seems to be working normally now.

Thanks much for your help.

vm’s picture

you're welcome

saltspringer’s picture

Oh darn, maybe it ISN'T fixed after all. Just got a similar warning this morning:

Notice: Undefined variable: field_view_mode in include() (line 11 of /home/votel970/public_html/sites/all/themes/lesliewallace/templates/field--image.tpl.php).
Notice: Undefined variable: field_view_mode in include() (line 16 of /home/votel970/public_html/sites/all/themes/lesliewallace/templates/field--image.tpl.php).
vm’s picture

Then an issue should be filed in the issue queue of the theme in question

saltspringer’s picture

Well, maybe it was a problem with an out-of-date version of the theme - I just upgraded to 2.2 for adaptivetheme and 'corolla', and it seems to be working fine.

But I'm still a bit confused; my sub-theme, lesliewallace, was a modified version of Corolla, which is a sub-theme of adaptivetheme. I thought I only needed my modified version of Corolla and adaptivetheme in there, but it seems that I need Corolla as well. To do the update, I took the new version of Corolla, added in my .info file and my modified CSS and installed it. Available Updates said it still needed to be updated. So I uploaded the updated version of Corolla AND the updated lesliewallace, and now the Available Updates is happy - everything is the current version and it seems to be working properly (but I'll keep checking).

So, is my 'sub-theme' really a 'sub-sub-theme' and do I need to have adaptivetheme, Corolla AND my modified version of Corolla all in there? It seems so to me, but I don't understand why.

vm’s picture

coralla is a subtheme of adaptive
if your theme is a subtheme of corolla then yes, you are dependent on both themes.

saltspringer’s picture

Okay, I get it. So does the previous absence of Corolla explain the error messages I was seeing?

saltspringer’s picture

Oh boy, maybe I'm not out of the woods yet...

Got the same error message when I went in to look at the log. Nowhere else though.

Searched through the adaptive themes support pages, but doesn't seem to be anybody else reporting the same problem, and though I registered with the site, it doesn't seem that you can post support questions.

I'm kind of regretting going with this theme - have about another ten Drupal sites running, mostly based on the Zen theme, and have never had this kind of trouble.

If anybody wants to go to the site and see if they get the same error message, I'd appreciate it:

http://www.votelesliecrd.ca

Thanks.

vm’s picture

an undefined index is typically a code issue. Hence, reporting it to the developer of the theme so it can be fixed properly and that fix rolled into a new release.

If the error is in your logs, but not on your screen are you sure, based on the timestamp, that the error isn't old?

as far as whether or not the missing corolla theme could be an issue = depends on whether or not you are truly using a subtheme of corolla, or if you've just taken corolla and renamed it.

saltspringer’s picture

Yes, I wanted to report the error in the support forum, but apparently you have to be a paid-up member to post, and I can't afford that right now.

No, the error message came at the top of the admin window, before I actually got to the log page.

And it's recorded in the log as two messages at 13:40 this afternoon, after I did the upgrade, and a little over an hour ago:

Notice: Undefined variable: field_view_mode in include() (line 16 of /home/votel970/public_html/sites/all/themes/lesliewallace/templates/field--image.tpl.php).

Notice: Undefined variable: field_view_mode in include() (line 11 of /home/votel970/public_html/sites/all/themes/lesliewallace/templates/field--image.tpl.php).
vm’s picture

no. The issue goes into the issue queue of the theme in question right here on d.o. Same place you looked for others reporting the issue.

One may also , if not using the tpl.php that is causing the issue. Remove it and test.

saltspringer’s picture

Oh, I must have been at the wrong place - I'll look for the right place.

And I might not be using Corolla properly as a sub-theme - not sure if I completely understand the difference...

vm’s picture

Doesn't sound like you are. At which point the changes in the new release of corolla would have to be placed in the custom theme you created.

Have you disabled your theme and tried only corolla? is the error still there?

If not, grab a copy of the offending tpl.php file from corolla and overright the copy in your custom theme.

Using subthemes properly means you can update the theme, without affecting your own subtheme. If you just rename a theme, then the updates never get to the theme you renamed.

Google, drupal subthemes for more information and consider correcting the issue.

Issue queues for all projects on d.o. are located on the project page of the module or theme downloaded ( in the right sidebar.)

saltspringer’s picture

Okay, I just replaced the field--image.tpl.php file from the new Corolla in my custom theme.

Before reporting it on http://drupal.org/node/add/project-issue/corolla, I'll see if that solves the problem.

And I will reread the instructions on properly creating a sub-theme...

Thanks for your help - much appreciated.

saltspringer’s picture

Okay, got the same error message AGAIN, so properly remade the sub-theme (I think) and for the moment it's working right.

aladdintech’s picture

I have been using adaptive themes for a few months and think they are great, however today I came across this very same message you described in this post, it seemedly started when I was working on the final details of microdata for the site. I'm curious, did you resolve your problem and how.
Many thanks -

jimi’s picture

Same problem today with a subtheme from sky…
* Notice : Undefined variable: field_view_mode in include() (line 11 in /…/themes/mysky/templates/field--image.tpl.php).
* Notice : Undefined variable: field_view_mode in include() (line 16 in /…/themes/mysky/templates/field--image.tpl.php).
AT + corolla + sky loaded
Media seems to me the cause of the bug ?…
Thx sory for my poor english