Download & Extend

Libraries without a name in info file cause PHP notice after cache clear

Project:Omega
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:himerus
Status:patch (to be ported)

Issue Summary

When a theme based on Omega is used that declares libraries without giving them a human-friendly name, the following PHP notice is displayed after performing a cache clear:

Notice: Undefined index: name in alpha_retrieve_libraries() (line 857 of themes/omega/alpha/includes/alpha.inc).

An example of an info file snippet (in the sub-theme) that will cause this issue is as follows:

libraries[omega_formalize][css][0][file] = formalize.css
libraries[omega_formalize][css][0][options][weight] = -20

The issue can be fixed by adding the name to the sub-theme info file (borrowed from the example in themes/omega/omega/omega.info):

libraries[omega_formalize][name] = Formalize
libraries[omega_formalize][css][0][file] = formalize.css
libraries[omega_formalize][css][0][options][weight] = -20

However, the code should be able to handle this small oversight without the notice.

Comments

#1

Status:active» needs review

The attached patch corrects this issue.

AttachmentSizeStatusTest resultOperations
1456504_libraries_missing_name.patch535 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1456504_libraries_missing_name.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#2

Status:needs review» needs work

The last submitted patch, 1456504_libraries_missing_name.patch, failed testing.

#3

Corrected patch. Updated to new D7 standard.

AttachmentSizeStatusTest resultOperations
omega-libraries_missing_name-1456504-3.patch539 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 0 pass(es).View details | Re-test

#4

Status:needs work» needs review

Setting to NR.

#5

Status:needs review» patch (to be ported)

Can be included in the 3.2 release

#6

Assigned to:GuyPaddock» himerus

I added $name instead of a blank '' which will take the name and insert it as a fallback incase so the readout is clear. Also updated the css declaration on line 827 for the same