Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Andrew Schulman CreditAttribution: Andrew Schulman commentedCorrection, this error also appears any time I view a view, not just when editing.
Comment #2
Andrew Schulman CreditAttribution: Andrew Schulman commentedMy Views module is 7.x-3.x-dev of June 4, 2011.
Comment #3
PI_Ron CreditAttribution: PI_Ron commentedI 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).
Comment #4
Andrew Schulman CreditAttribution: Andrew Schulman commentedThe 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.Comment #5
doms_fr CreditAttribution: doms_fr commentedHi,
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.
Comment #6
Luna Vulpo CreditAttribution: Luna Vulpo commentedI have same problem.
Your solution work for me, but this is only temporary solution because it should be correct same else i think.
Comment #7
Niubbo75 CreditAttribution: Niubbo75 commentedSame 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.
Comment #8
Andrew Schulman CreditAttribution: Andrew Schulman commentedMaybe 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.
Comment #9
NickWebman CreditAttribution: NickWebman commentedline 23 of what? (sorry)
edit: /templates/views-view--page.tpl.php (got it)
Comment #10
r0ber CreditAttribution: r0ber commentedslution 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)):
Comment #11
boran CreditAttribution: boran commentedAfter 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?
Comment #12
JoshOrndorff CreditAttribution: JoshOrndorff commentedDeleting the file entirely worked for me. As was mentioned, I'm not sure why that file needs to be overridden to begin with.
-Josh
Comment #13
MStrzelecki_ CreditAttribution: MStrzelecki_ commentedreplace line 23 with
if (isset($admin_links)):
solved the problem for me.Comment #14
Jens Peter CreditAttribution: Jens Peter commentedboth #5 and #10 works on my solution.
In both cases I do lose the "hover links" but the error is gone.
Comment #15
Bathie CreditAttribution: Bathie commentedHello, I have the same problem. I just change file views-view--page.tpl.php in views-view--page.tpl.phpx and it works perfect.
Comment #16
CPJS CreditAttribution: CPJS commentedTry #10. This works.
Comment #17
Florian CreditAttribution: Florian commentedThis was fixed in 7.x-1.2 release of ZeroPoint theme.