Hi!

There is a problem if we use Panels, Search-Api, Search-Views-Integration, FacetedSearch together with AT.

Notice: Undefined offset: 0 in adaptivetheme_item_list() (Zeile 220 von /.../htdocs/sites/all/themes/adaptivetheme/at_core/inc/theme.inc).

We use the newest version of the modules and Drupal Core.

Wr
Paulap

Comments

Jeff Burnz’s picture

Category: Bug report » Support request
Priority: Major » Normal

Wooo, slow down there partner, if you can show me the bug I'm all ears, I would tend to think one of those modules is implementing theme_item_list and incorrectly adding a class, possible with a variable that is empty - that is a more likely scenario.

try var_dump($attributes); on line 216 of theme.inc in AT Core and paste the output.

I mean I could run more conditions here but attributes is always meant to be an array and items should be set and not empty etc.

romansta’s picture

Got the same notice with Search-Api, Search-Views-Integration, FacetedSearch, but without Panels. Since there were only three ...

Jeff Burnz’s picture

And the debug output as per instructions in #1 ?

zeezhao’s picture

Got similar error message using search_api, search_api_page, facetapi. I am using the adaptivetheme-7.x-3.x-dev with corolla-7.x-3.x-dev.

Debug output as per #1 is

array(1) { ["class"]=> array(0) { } } array(2) { ["class"]=> array(2) { [0]=> string(23) "facetapi-facetapi-links" [1]=> string(21) "facetapi-facet-author" } ["id"]=> string(56) "facetapi-facet-search-apidefault-node-index-block-author" } 

Thanks

Jeff Burnz’s picture

OK, on line 222 in theme.inc in AT Core, where the code is:

if (isset($attributes['class'])) {

change to

if (isset($attributes['class'][0])) {

See if that clears up the problem.

FacitAPI seems to set some classes here (roughly from what I can tell in http://cgit.drupalcode.org/facetapi/tree/plugins/facetapi/widget_links.inc) and I am not entirely sure why it's doing this the way it is (I mean it could have some purpose like JS hooks etc), but for some reason we have two class arrays and one is empty, which is causing the notice.

zeezhao’s picture

Thanks for your suggestion. It seems to clear it up for me. It's actually line 219 in latest dev version
("7.x-3.2+2-dev" of 2014-04-29).

Jeff Burnz’s picture

Status: Active » Closed (duplicate)

Theres a patch in the other issue, lets switch to that one: #2279597

redhatusr’s picture

same notice with Search-Api without Panels, solution #5 did not solve the problem

Search (search)                                     7.31
Display Suite Search (ds_search)                    7.x-2.6
Database search (search_api_db)                     7.x-1.4
Search API (search_api)                             7.x-1.13
Search API autocomplete (search_api_autocomplete)   7.x-1.1
Search API Page Block (search_api_page_block)       7.x-1.0-beta1
Search facets (search_api_facetapi)                 7.x-1.13
Search pages (search_api_page)                      7.x-1.1
Search ranges (search_api_ranges)                   7.x-1.5
Search sorts (search_api_sorts)                     7.x-1.5
Search views (search_api_views)                     7.x-1.13
Current Search Blocks (current_search)              7.x-1.5
Facet API (facetapi)                                7.x-1.5
Facet API Bonus (facetapi_bonus)                    7.x-1.1