Index on title field off -> collection log bombs out

32 views
Skip to first unread message

Oliver Slay

unread,
Aug 20, 2015, 11:25:12 AM8/20/15
to ResourceSpace
Hi

We switched off indexing on the Title field (ref=8).  Whilst this might be a temporary change, it has thrown an issue... 

The config setting $view_title_field is set to 8 in config.default.php... 

In collection_log.php, get_fields  is called with $view_title_field:

<td><?php $field=get_fields(array($view_title_field)); echo lang_or_i18n_get_translated($field[0]["title"], "fieldtitle-");?></td>

Tracing this through to get_fields in include/general.php:

$fields=sql_query("select ref, name, title, type, options ,order_by, keywords_index, partial_index, resource_type, resource_column, display_field, use_for_similar, iptc_equiv, display_template, tab_name, required, smart_theme_name, exiftool_field, advanced_search, simple_search, help_text, display_as_dropdown,tooltip_text,display_condition, onchange_macro from resource_type_field where  keywords_index=1 and length(name)>0 and ref in ('" . join("','",$field_refs) . "') order by order_by");

This is retrieving all resource_type_fields where keywords_index=1 .. and ref = $view_title_field .. which is 8 = Title.

I think this was designed to return Title generally and in most cases will return a single row... if you switch off indexing on the Title field, however, nothing is returned... 

So back in collection_log there's an assumption that rows have been returned...  in $field[0]...

<td><?php $field=get_fields(array($view_title_field)); echo lang_or_i18n_get_translated($field[0]["title"], "fieldtitle-");?></td>

And it crashes out with :

/mnt/datadisk/var/www_resourcespace/pages/collection_log.php line 59: Undefined offset: 0

I'm not at SVN level yet .. and currently busy bringing an old copy up to date... I checked the code in SVN and this code still remains... 

Oliver

Oliver Slay

unread,
Aug 20, 2015, 11:30:11 AM8/20/15
to ResourceSpace
I think for the time being I can replace that whole line:

<td><?php $field=get_fields(array($view_title_field)); echo lang_or_i18n_get_translated($field[0]["title"], "fieldtitle-");?></td>

with 

<td>fieldtitle-Title</td>

If that is all it is going to produce on our system...?

Oliver


Reply all
Reply to author
Forward
Message has been deleted
0 new messages