Closed (fixed)
Project:
Nodewords: D6 Meta Tags
Version:
5.x-1.10
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Aug 2008 at 19:57 UTC
Updated:
1 Apr 2009 at 15:30 UTC
upgrading from 1.9 to1.10 gave me the following error:
warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in /home/example/public_html/logos/sites/all/modules/nodewords/nodewords.module on line 933.
any thoughts?
regards,
Luciano
Comments
Comment #1
kmillecam commentedI'm getting the same error.
array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in /srv/drupal/htdocs/communities/sites/all/modules/nodewords/nodewords.module on line 933.
Comment #2
KerrySanto commentedyep am getting the same error also, it has something to do with the views module but I am not entirely sure what to fix as the line 933 is part of this
929 if (module_exists('views')) {
930 static $views_urls;
931 // Get all urls from views cache.
932 if (!is_array($views_urls)) {
933 $views_urls = array_flip(views_get_all_urls());
}
Comment #3
kbahey commentedSame error when I upgraded a site to 5.x-1.10.
Perhaps the views_get_all_urls() is not returning a simple two dimension array, but rather an array of arrays, and that is why array_flip() is erroring out.
As a temporary measure I just changed this:
To this:
This only hushes the message, until we get a real fix.
Comment #4
Robrecht Jacques commentedCan someone who gets this error tell me what
views_get_all_urls()returns on their site?For example: install devel module, enable the "Execute php" block and insert into it:
Alternatively (also with devel module installed), edit
nodewords.moduleand addbefore
After doing this you get a message like (if you go to
adminfor example):Paste that code here.
Thanks.
Can you also tell me which version of views module you use?
I can't seem to be able to reproduce and looking at the code in
views_get_all_urls()it does return a simplestring => stringarray so I'm not sure what is going on.Comment #5
siliconmeadow commentedHi,
Here are my results:
Running:
The error seems to be appearing on every page but the front page.
Since the 'image_gallery' didn't have a value assigned, I disabled that view and the problem disappeared. Perhaps it's not dealing with nulls properly?
HTH,
Richard
Comment #6
Robrecht Jacques commentedThanks a lot. This seems to be a bug in image-2.0-alpha2 - the moment I enable that version of image module, I get the exact same bug. This is due to the fact that a view it defines ("image_gallery" from the image_gallery contrib module) has no URL defined, so this is set to NULL and then the
array_flip()indeed fails.A view that provides a page but not sets the URL is an error - I'll report this to the image_gallery maintainers.
I've fixed this in 5.x-1.11 released shortly by removing empty and NULL urls.
Thanks for the feedback siliconmeadow!
Comment #7
siliconmeadow commentedMy pleasure!
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #9
joachim commentedIt's possible for page views in D5 to not specify a path. For example, they may be views that are meant to be used as embedded views. This is the case with the image gallery view.
The patch on image_gallery needs to be rolled back as it broke galleries. I could set a fake path on that view, but I think a better fix would be for nodewords to run its array through an array_filter().
Reopening.
Comment #10
Robrecht Jacques commentedThis has been fixed in nodewords:
When you create a page view in D5 the description says:
This may have changed in later views versions or is not a real requirement (so the docs are wrong).
Whether image_gallery fixes that or not is no longer a concern to nodewords.
So reclosing it as "fixed" because if is fixed by using an array_filter() in nodewords.
Comment #11
joachim commentedAh, sorry -- I didn't read all the comments properly!