After enable the date repeat api, it shows:

Notice: Undefined index: repeat in date_repeat_field_bundles() (line 165 of /home/mydrupal/sites/all/modules/date/date_repeat_field/date_repeat_field.module).

Comments

Exploratus’s picture

Me too!

Exploratus’s picture

Could it be a language issue?

phl3tch’s picture

StatusFileSize
new866 bytes

This appears to just be a simple case of the function at fault not checking whether $field['settings']['repeat'] actually exists. I've attached a patch which should probably be rolled into the next release, but in practice this error shouldn't cause any problems.

phl3tch’s picture

StatusFileSize
new868 bytes

Oops. Left a paren out of that last patch.

phl3tch’s picture

StatusFileSize
new878 bytes

Oh Lord, this is not my day.

One more correction. Honestly, this one works properly.

Exploratus’s picture

Thanks, tested it and the error didnt come up when I uninstalled and reinstalled. Also, my date field kept dissapearing when I turned on the date repeat field module, and now it's not.

phl3tch’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, fix_undef_index_err-1856306-5.patch, failed testing.

phl3tch’s picture

So I ran tests and found that this failure occurs regardless of whether patch #5 is installed or not. Anyone know what to do in that event?

h3rj4n’s picture

I also want to know that answer, also got a patch that works fine (#1866684: Value not inherited from parent element) but the test failes on some bug that was already there?

phl3tch’s picture

Status: Needs work » Needs review

Retesting

redndahead’s picture

StatusFileSize
new835 bytes

I think just having a !empty should take care of it.

Status: Needs review » Needs work

The last submitted patch, 1856305-d7-1.patch, failed testing.

WebSinPat’s picture

i get the same error upon enabling date repeat. I'm using 7.x.2.6, within drupal commons 7.x.3.2
I would apply a patch, once a solid one is submitted?

thanks.

jenifertucker’s picture

Ditto.

Also getting the same message in Drupal 7.22 core and Date Repeat API 7.x-2.6 and Date Repeat Field 7.x-2.6.

Yet to see if it breaks anything (setting up multilanguage site).

redndahead’s picture

Status: Needs work » Needs review

#12: 1856305-d7-1.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1856305-d7-1.patch, failed testing.

mgifford’s picture

The patch is pretty trivial. No idea why it is failing, but I can verify that it's still a problem.

TWD’s picture

Undefined index: repeat in date_repeat_field_bundles() (line 165 of /home1/MYSITE/public_html/sites/all/modules/date/date_repeat_field/date_repeat_field.module)

Subscribing.

jacobson’s picture

Title: Undefined index: repeat in date_repeat_field_bundles() » "Subscribing" Not Necessary / Deprecated

Please note that "subscribing" to Issues is no longer good practice. You will see a Follow button at the top of every issue (if you are logged into d.o). Use the Follow button to subscribe.

jacobson’s picture

Title: "Subscribing" Not Necessary / Deprecated » Undefined index: repeat in date_repeat_field_bundles()

Fix erroneous change of Issue title

kingfisher64’s picture

This is still an issue with the very latest dev of date version 7.x-2.x-dev 2013-Nov-29.

Any suggestions?

cmwelding’s picture

Issue summary: View changes

I am getting same error message:

Notice: Undefined index: repeat in date_repeat_field_bundles() (line 165 of /home/mysite/public_html/sites/all/modules/date/date_repeat_field/date_repeat_field.module).

I am using Date iCal for calendar feed and repeating dates only show up on the first day. Don't know if this problem is due to this error.

marcissimus’s picture

My suggestion would be

function date_repeat_field_bundles() {
  $values = array();
  foreach (field_info_fields() as $field_name => $field) {
//    if (in_array($field['type'], array('date', 'datestamp', 'datetime')) && $field['settings']['repeat']) {
    if (in_array($field['type'], array('date', 'datestamp', 'datetime')) && date_is_repeat_field($field)) {
      foreach ($field['bundles'] as $entity_type => $bundles) {
        foreach ($bundles as $bundle) {
          $values[$entity_type][$bundle][] = $field_name;
        }
      }
    }
  }
  return $values;
}
maen’s picture

Saw this thread with a half bottle of wine in my head (no beer although I'm German), I solved this like this (too lazy to make a diff):

/**
 * Return an array of all entity types and bundles that have repeating date fields.
 */
function date_repeat_field_bundles() {
  $values = array();
  foreach (field_info_fields() as $field_name => $field) {
    if(isset($field['settings']['repeat'])){
      if (in_array($field['type'], array('date', 'datestamp', 'datetime')) && $field['settings']['repeat']) {
        foreach ($field['bundles'] as $entity_type => $bundles) {
          foreach ($bundles as $bundle) {
            $values[$entity_type][$bundle][] = $field_name;
          }
        }
      }
    }
    }
  return $values;
}
7thkey’s picture

StatusFileSize
new1015 bytes

Maen solution works, i did the diff patch over the dev version.
Changing the topic to development version.

7thkey’s picture

Version: 7.x-2.6 » 7.x-2.x-dev
Status: Needs work » Needs review
joelstein’s picture

Here's a patch which fixes the same notice in a couple other places.

steinmb’s picture

Env: drupal 7.x-dev PHP 7.2.11

Retested #28 and it is OK, but not really sure that we still need the empty checks outside date_repeat_field_bundles() at least I was unable to provoke them on the latest date. Perhaps they have been addressed in other issues? I suggest we only address this one. date_repeat_field_bundles() is called from date_repeat_field_menu() (hook_menu) on installation and other operations so we have to check it.

Roll a one liner. It also contain a micro optimization. Swapped the order so first always check a single value.