I'm using Drupal 7.4 and I've enabled the 'Popular content' view of Views 3 (latest dev version). There, I've restricted the access to administrators only.
If an anonymous user accesses /popular of the 'Popular content' view, he gets the following warning:
Warning: array_shift() expects parameter 1 to be array, string given in views_page_title_pattern_alter() (Line 18 /home/staging/public_html/d7/sites/all/modules/page_title/modules/views.page_title.inc).
Warning: array_shift() expects parameter 1 to be array, string given in views_page_title_pattern_alter() (Line 19 /home/staging/public_html/d7/sites/all/modules/page_title/modules/views.page_title.inc).
Comments
Comment #1
jg314 commentedI am getting this same error using Drupal 7.7 with Views 7.x-3.0-rc1. Any suggestions?
Comment #2
carl.brown commentedI've been encourntering the same thing... It seems that in some cases,
$argsis not an array, hence the warning (array_shift()can only operate on an array ).To get around the warning, I just checked if it's an array first, however, it doubt that this is the greatest idea as the rest of the
views_page_title_pattern_alter()could still potentially run I think.Not submitting a patch, as I don't think this is the right solution!
Here's the revisted function from views.page_title.inc
Comment #3
nagiek commentedAre the maintainers looking into this problem? I also have this issue.
Comment #4
jeffschulerWell, it may not be the right solution, but maybe more likely to get reviewed if we make a patch and mark as such. :)
Comment #5
marcoka commentedi can confirm this. anonymous user, message from logfile
Warning: array_shift() expects parameter 1 to be array, string given in views_page_title_pattern_alter() (Zeile 19 von /var/www/test/sites/all/modules/contrib/page_title/modules/views.page_title.inc).
Comment #6
marcoka commentedany opinions of the maintainers on this patch? i mean its a small one and seems to work.
Comment #7
nicholasthompsonIt looks like $args remains serialized on a 403... How odd!
I have applied a different patch, one that just
return FALSE;as I personally wouldn't want Page Title to be messing about with SEO on a 403 page where Drupal hasn't even finished unserializing the menu page arguments - it looks like very uncertain waters to be treading in. There might even be chunks of the Views API which aren't loaded.Nice catch - Patch committed to dev. Tagged release soon.
(FYI)
Comment #8
nicholasthompsonActually... I just realised D6 had the error fixed in it anyway just adding an
is_array()check at the beginning. This is a far more simple fix + it keeps it consistent with D6...Comment #10
summit commentedHi, Is this fix (#8) committed please?
Edit: Somehow I also needed to add a end-bracket (}) to the end to get this working, complete file:
Thanks in advance if so!
Greetings, Martijn
Comment #10.0
summit commentedadded Drupal version