When I edit any view, I get an error message at the top of the page, saying:

Notice: Undefined variable: admin_links in include() (line 23 of /home/andrex/html/nitbafs.org/trunk/sites/all/themes/zeropoint/templates/views-view--page.tpl.php).

Comments

Andrew Schulman’s picture

Title: "Undefined variable: admin_links" when editing a view » "Undefined variable: admin_links" in views

Correction, this error also appears any time I view a view, not just when editing.

Andrew Schulman’s picture

My Views module is 7.x-3.x-dev of June 4, 2011.

PI_Ron’s picture

I think this may be a views issue not Zero Point (I'm not using zero point and I am getting this notice, using views-7.x-3.x-dev).

Andrew Schulman’s picture

The line that causes the error is <?php if ($admin_links): ?>. Not sure if that's views' fault or not. If views is supposed to always provide $admin_links, then yes, I guess this is a bug in views.

doms_fr’s picture

Hi,

I have the same problem (save version as you). I do not find the file in views archive, so I think it may be a zeropoint problem except if views, as said, must always provide $admin_link.

To temporarly correct this, I just put on the line 23 :
if (isset($admin_links) && $admin_links):

It seems to work fine (for now).

Doms.

Luna Vulpo’s picture

I have same problem.
Your solution work for me, but this is only temporary solution because it should be correct same else i think.

Niubbo75’s picture

Same problem here, but I think this is a Theme issue becouse I have others websites using the same views module and other themes and I do not have this issue (is a multisites installation).
The solution posted by Dom work also for me.

Andrew Schulman’s picture

Maybe those other themes aren't using the $admin_links variable.

To me the question is whether Views is always supposed to set $admin_links. If it is, then this bug is Views' fault and it should be reassigned there. If it's not, then the fix in #5 is the right one.

NickWebman’s picture

line 23 of what? (sorry)

edit: /templates/views-view--page.tpl.php (got it)

r0ber’s picture

slution is very simple, the problem is from this line : 23
You have to replace this code: if (isset($admin_links)):
for this:
if (isset($admin_links)):

boran’s picture

After an upgrade to 7.x, I just noticed this too, and the fix in #5 works.
However I'm not convinced its the real solution, for example I don't see the views "hover links" on views.
So maybe there is a views compatibility issue (see also http://drupal.org/node/1097482).
Is it even necessary for zeropoint to override ../../modules/views/theme/views-view.tpl.php with templates/views-view--page.tpl.php?

Hmm. Reading http://drupal.org/node/1097482 if seems zeropoint needs to support D7 contextual links?

JoshOrndorff’s picture

Deleting the file entirely worked for me. As was mentioned, I'm not sure why that file needs to be overridden to begin with.

-Josh

MStrzelecki_’s picture

replace line 23 with if (isset($admin_links)): solved the problem for me.

Jens Peter’s picture

both #5 and #10 works on my solution.
In both cases I do lose the "hover links" but the error is gone.

Bathie’s picture

Hello, I have the same problem. I just change file views-view--page.tpl.php in views-view--page.tpl.phpx and it works perfect.

CPJS’s picture

Try #10. This works.

Florian’s picture

Status: Active » Closed (fixed)

This was fixed in 7.x-1.2 release of ZeroPoint theme.