On a vanilla install, I installed freelinking and freelinking_prepopulate.

On the Freelinking Settings page (/admin/config/content/freelinking), I load the page and save without changing any settings and the following warning is displayed:
An illegal choice has been detected. Please contact the site administrator.

The dblog shows this:
Illegal choice 0 in Advanced Options element.

If I uncheck the "Advanced Options" checkbox, the Freelinking Setting form submits just fine.

I did some variable dumping from the freelinking_prepopulate.module around lines 110. It looks like the $options array has one element that is NULL. I suppose that element probably shouldn't be created, or the empty($options) check needs to change.

... a little GIT blame investigating seems that maybe this bug was in commit #124d6ae.

CommentFileSizeAuthor
#4 1689918-list_fields.patch4.05 KBbc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xurizaemon’s picture

EDIT: See below.

You're right, I think that line should be

$nodecreate = freelinking_prepopulate_list_fields('nodecreate');

not

$nodecreate[] = freelinking_prepopulate_list_fields('nodecreate');

xurizaemon’s picture

Status: Active » Needs work

OK, this was masking some other weirdness ... freelinking_prepopulate_list_fields('nodecreate') returns different results on being called a second time. Doing this actually gives labels to the checkboxes (obviously we should fix the underlying issue instead).

  $ignore = freelinking_prepopulate_list_fields('nodecreate');
  foreach (freelinking_prepopulate_list_fields('nodecreate') as $key => $value) {
    $options[$key] = $value['title'];
  }
 
dooug’s picture

Status: Needs work » Closed (duplicate)

Right. Looks like the debugging/patching for these issues will be happening here: #1665010: Recursion bug in D7 branch when references are circular

bc’s picture

Status: Closed (duplicate) » Needs review
FileSize
4.05 KB

this may or may not be a discrete issue.

in the attached patch i did a few things:

  • removed freelinking_prepopulate.api.php from the submodule's .info file - really we should take a look at this file and trim it down
  • changed $nodecreate[] to $nodecreate as suggested in comment 1 above
  • reordered the statements in freelinking_prepopulate_list_fields() to fix this bug

i'll be testing this to see if it has any effect on #1665010: Recursion bug in D7 branch when references are circular

gisle’s picture

Issue summary: View changes
Status: Needs review » Needs work

This whole issue comes from a checkbox to toggle a variable freelinking_prepopulate_node_advanced in the freelinking_prepopulate module.

gisle’s picture

Status: Needs work » Closed (duplicate)
Parent issue: » #2120353: freelinking prepopulate migration bug from d6 to d7

Looks like this is a duplicate of #2120353: freelinking prepopulate migration bug from d6 to d7. While this is an older issue the solution in the other thread looks promising, so I am going to base further work on that.