Latest build: Display Suite 7.x-2.x-dev (2012-May-31). Error displays on Manage Display pages, and node pages (?).

Notice: Undefined offset: 1 in _ds_field_ui_fields() (line 1824 of /home/me/public_html/thct.mysite.com/sites/all/modules/ds/includes/ds.field_ui.inc).

Seems that your default value "#" is triggering this now. (Don't recall that being the case before.) But, it cannot be deleted -- after deleting the "#" sign and saving the build, the symbol returns. Kinda an endless validation loop.

In my case, the field is a slideshow field (Field Slideshow 7.x-1.6). My builds, Teaser with and Full Contnet without using offset, were working fine before updating to this latest build.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

Status: Active » Postponed (maintainer needs more info)

If I look at that line (in my local installation), this has something todo with a custom fields. Do you have a custom field in your installation, if so, look at the 'UI limit' textarea on the custom field form, because it has invalid data in that case. The '#' that returns is no problem at all.

swentel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
yeken’s picture

> created a code field for user (set limit field to *)
> under user display got the Notice: Undefined offset: 1 in _ds_field_ui_fields() error code

It had to do with the "limit field" textarea while defining the code field, i then left it blank and the problem was solved.

drvdt’s picture

It caused by you chose the wrong filter. Change "Display Suit code" to "HTML" or something else.

aimevp’s picture

Status: Active » Closed (cannot reproduce)

I got this same error after selecting a DS layout on the "Manage Display" page of a taxonomy vocabulary.
When changing it back to 'no layout' selected the error disappears.

I also have a few custom fields on that vocabulary but none of them have a limit.

This was the exact error message:
Notice: Undefined offset: 1 in _ds_field_ui_fields() (line 1857 of /path/to/site/www/sites/all/modules/contrib/ds/includes/ds.field_ui.inc).

I'm working on a Drupal 7.22 with Display Suite 7.x-2.4.
If you need any other information, just let me know.

aimevp’s picture

Version: 7.x-2.x-dev » 7.x-2.4
Status: Closed (cannot reproduce) » Active
swentel’s picture

Version: 7.x-2.4 » 8.x-2.x-dev
Status: Closed (cannot reproduce) » Patch (to be ported)
FileSize
829 bytes

That's because '*' alone doesn't work. It needs to be *|* then. I've updated the documentation a bit though in the interface.

Moving to 8.x-2.x as well.

swentel’s picture

Status: Patch (to be ported) » Closed (fixed)

Committed and pushed to 8.x-2.x

adaddinsane’s picture

I'm afraid that guidance does not necessarily help because it's very easy to add a blank line after putting something in the field and once again the error occurs. Filtering out blanks lines might be useful.

Obviously it's not a critical problem but it is irritating.

kappaluppa’s picture

I am getting this problem on Display Suite 7.x-2.6

If I create a custom display
and
use a any layout other than 'none'
the item number option field is displayed with '#' entered in the box. I cannot delete the '#' - when I do and save, it comes right back.

The error appears whether the field (all taxonomy) is active, hidden or disabled.

aspilicious’s picture

The '#" is the default, meaning load everything

claudiu.cristea’s picture

Version: 8.x-2.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Closed (fixed) » Active

This is caused also by empty lines at the end (or within) the limitation text area.

claudiu.cristea’s picture

Status: Active » Needs review
FileSize
1.52 KB

Here's a patch for 7.x-2.x-dev. I fixed also the line endings conversion which was incomplete. There are 2 conversions to be made:

  1. \r\n (Win) => \n (Unix)
  2. \r (Mac, old style) => \n (Unix)

Only the first has been covered.

aspilicious’s picture

Assigned: Unassigned » bceyssens
bceyssens’s picture

I added an element validation function to check the ui_limit field entry to prevent the "Undefined offset" error from occurring. I also moved pieces of patch #13 to this function so it will be stored in the database correctly. This should fix both issues.

claudiu.cristea’s picture

  1. +++ b/modules/ds_ui/includes/ds.fields.inc
    @@ -192,6 +193,74 @@ function ds_shared_form(&$form, $field) {
    +  $entity_info = entity_get_info();
    ...
    +      if (empty($bundle) || empty($view_mode) || !_ds_check_existing_ui_limit($entity_info, $entities, $bundle, $view_mode)) {
    ...
    +function _ds_check_existing_ui_limit($entity_info, $entities, $bundle, $view_mode) {
    

    There's no reason to extract the huge entity info array here only to pass it to _ds_check_existing_ui_limit(). Instead get the info inside the function:

    foreach ($entities as $entity) {
      $info = entity_get_info($entity);
    

    You can also rename $entity to $entity_type to be consistent with Entity API coding.

  2. +++ b/modules/ds_ui/includes/ds.fields.inc
    @@ -192,6 +193,74 @@ function ds_shared_form(&$form, $field) {
    +  // Get all enabled entities
    

    Must end with dot.

  3. +++ b/modules/ds_ui/includes/ds.fields.inc
    @@ -192,6 +193,74 @@ function ds_shared_form(&$form, $field) {
    +      // Each line should hold a pipe character to seperate bundle and view_mode
    

    Should end with dot.

  4. +++ b/modules/ds_ui/includes/ds.fields.inc
    @@ -192,6 +193,74 @@ function ds_shared_form(&$form, $field) {
    +      if (strpos($line, '|') == FALSE) {
    

    Use === operator here to detect a strict FALSE, not 0 (if the pipe is the first char).

  5. +++ b/modules/ds_ui/includes/ds.fields.inc
    @@ -192,6 +193,74 @@ function ds_shared_form(&$form, $field) {
    +    // Set trimmed and validated entry back as value
    

    Missing end dot.

  6. +++ b/modules/ds_ui/includes/ds.fields.inc
    @@ -192,6 +193,74 @@ function ds_shared_form(&$form, $field) {
    +    // Combine allowed bundles and entity specific ones
    ...
    +    // Combine allowed view_modes and entity specific ones
    

    Missing end dot.

I don't understand why we do the check in _ds_check_existing_ui_limit(). That seems to me a little bit over engineered.

bceyssens’s picture

I checked with aspilicious, he thought it would be better to check if the bundle/view mode combination was valid. If this is not the case we should let the user know. Here's the new patch.

claudiu.cristea’s picture

Can you provide an interdiff please?

claudiu.cristea’s picture

Status: Needs review » Reviewed & tested by the community

Anyway, looks good to me. Thanks.

bceyssens’s picture

The interdiff of #17

  • bceyssens committed 980b66f on 7.x-2.x
    Issue #1623590 by bceyssens, claudiu.cristea, swentel: Notice: Undefined...
bceyssens’s picture

Status: Reviewed & tested by the community » Fixed

Thank for the input guys!

Status: Fixed » Closed (fixed)

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