When installing this module on D7 (either by using the UI and by unpacking it manually) i get barrels of notifications:
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in system_sort_modules_by_info_name() (line 926 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Warning: uasort(): Array was modified by the user comparison function in system_modules() (line 773 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).
Notice: Undefined index: name in _system_modules_build_row() (line 959 of C:\xampp\htdocs\drupal7\modules\system\system.admin.inc).

They are generated while sorting modules by name. There is now a new module entry without name, with the same version of libraries; this modules introduces that entry (deleting the module's folder confirms it). Ignoring those warning and enabling the module leads to system breakage (WSOD?).

This behavior should be caused by a buggy .info file. I'm new to this, but that file seems ok =| Drupal7 version is beta1.

(i can't get a better title right now)

Comments

tstoeckler’s picture

Title: Enabling module leads to WSOD » Notices on the modules page (due to fake info file)
Priority: Critical » Normal
Status: Active » Fixed
StatusFileSize
new746 bytes

This is a result of the project module on drupal.org padding our fake info file with 'project information'. Due to the fact that we now have a fake .module file (to prevent SimpleTest breakage) Drupal thinks there is a module and tries to load it (Hurray for qa.drupal.org vs. drupal.org...). Because there is no name in the info file, the errors above arise. And an empty entry comes up on the modules page.
(By the way, that's not a WSOD :) )
It's not critical, because the module is fully usable as is, but should be fixed nonetheless.
Since this is a non-issue in the long-term anyway (the .module file will go eventually...) I decided to commit this little patch, which just adds
hidden = TRUE
to our fake info file. I double checked that it removes all notices and also the empty entry on the modules page.

http://drupal.org/cvs?commit=436094

Thanks Eons for reporting this issue. Please wait for at least 12 hours and then try out the new development snapshot to see if the problem persists.

sun’s picture

Status: Fixed » Active

Let's also rename "example" into "libraries_example". "example" is clobbering a namespace we do not own.

tstoeckler’s picture

Do you only mean the .info and .module files or all files in there?
In #919632: Allow library information to be stored in info file I proposed to rename the info file to example_info_file.info, so that the library name comes up as 'example_info_file' which is consistent with e.g. 'example_undetected'.

sun’s picture

We can leave the other example library files as is, because they do not participate in any system. The .info + .module files, however, are discovered by Drupal's module system, so right now, we potentially override/replace another module that happens to use the internal name "example".

Interestingly, this will be the major problem with the .info file support... projects/modules are not able to just put them somewhere, because they always lead to this auto-detection problem. Right now, the only way I could see to allow modules to provide .info files for libraries would be to put them in a "hidden" directory; i.e., starting with a dot/period; e.g., ./.libraries.

Technically, one could say that this is a bug in Drupal core and SimpleTest... the sole existence of an innocent .info file should not trigger any errors. :-|

tstoeckler’s picture

1. I just realized that we can achieve the naming consistency and still name the file libraries_example.info by declaring name = example_info_file in the info file. We're basically hacking our own API that way, but...

2. ... those are definitely bugs, coming from the viewpoint of Libraries API. On the other hand, how is Drupal supposed to 'know' that one .info file in */modules/* is a module and another isn't? At least I couldn't think of a solution first-hand. We should still open a bug report for that, though, I think.

3. In contrib, we still have the option to simply force .info files into */libraries/ directories. While that would alleviate the above problem, it is not as comfortable in terms of simply downloading a module. Maybe we can end-up leveraging some new distro/packaging tools for that.

tstoeckler’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

Of course, the existing 'example.info' and 'example.module' would have to be removed when committing.

sun’s picture

Status: Needs review » Reviewed & tested by the community
+++ tests/example/libraries_example.info	15 Oct 2010 13:02:48 -0000
@@ -0,0 +1,11 @@
+; Because Drupal thinks this in a module's .info file, it is in the 'libraries'

Typo in s/in/is/

Aside from that, ready to fly - thanks!

Powered by Dreditor.

tstoeckler’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new1.39 KB

Committed the attached patch (Notice I also changed "...file for a library..." to "...file of a library..."

http://drupal.org/cvs?commit=436518

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.