Great module, thank you. However, getting: Notice: Undefined variable: paths in views_ui_basic_admin_paths() (line 67 of .....views_ui_basic.module. Any thoughts?

CommentFileSizeAuthor
#6 undefined_paths-1082666-6.patch376 bytesakeemw

Comments

ap’s picture

I'm having the same problem.

This function is the culprit. The variable $paths is undefined when the "if" evaluates to false.

function views_ui_basic_admin_paths() {
  $items = array();
  _views_ui_basic_define_menu($items);
  if ($items) {
    $paths = array_keys($items);
    $paths = array_combine($paths, array_fill(1, count($paths), TRUE));
  }
  return $paths;
}

Not sure if $paths should be initialized to FALSE or array().

But it seems like it's not that important. I've done a grep over my entire Drupal installation and this function nowhere called. I've added a line to initialize the $paths variable. I've used this as a stopgap measure to eliminate the warnings. THIS IS NOT A PERMANENT SOLUTION!!!. I don't know if this function is needed or what ramifications this change may have. But since it is not used anywhere I feel safe for the time being.

function views_ui_basic_admin_paths() {
  $paths = array();
  $items = array();
...
Anonymous’s picture

Ah, someone who knows about these things! Could you tell me which file to edit and where to paste the edit and I'll use your work around for the moment as well. Many thanks.

ap’s picture

The change is in this file at line 60.

.../sites/all/modules/views_ui_basic/views_ui_basic.module

The directory for your installation may differ.

-----

I just noticed that the comment above the function mentions hooks. This means the function may be called from somewhere in such a way that my grep search is not conclusive. I.e. maybe it is called somewhere.

Actually, it just occurred to me how stupid I am. If the function were not called the warning could never occur.
Anyway I made the change and things still work.

Anonymous’s picture

Thank you.

cfischer50’s picture

Logically, that function needs $paths to be defined BEFORE the condition ... so I think ap did it right. Thanks for posting!

akeemw’s picture

StatusFileSize
new376 bytes

Yup, ap did it right. hook_admin_paths expects an array to be returned.

askibinski’s picture

that patch did the trick.

Anonymous’s picture

Thanks everyone. Patch works a treat.

beanworks’s picture

Thanks for posting the fix. :)
Any chance it will get into a dev version or the main version any time soon? Or maybe a note on the project page about it for the unwary? :)

sachbearbeiter’s picture

subscribe

Jonah Ellison’s picture

Status: Active » Closed (fixed)

Patch applied to 7.x-1.1 release. Thanks guys.