Hi,

I tried to import an OPML file and got the error message "An illegal choice has been detected. Please contact the site administrator." on every RSS-entry in the OPML file.

Example of OPML-File saved as text-file is attached

Thanks for your help

CommentFileSizeAuthor
deutsche.txt4.9 KBviadimezzo

Comments

ParisLiakos’s picture

Category: bug » support

Did you try to reload the form and then reimport? i just tried it and works..maybe a custom module interferes?

ParisLiakos’s picture

Status: Active » Closed (cannot reproduce)
carchak’s picture

hi, I've got the same problem. I've tried with reformating the opml files, doesn't work. Got "An illegal choice has been detected. Please contact the site administrator." for each feed.
The error is generated in the form.inc :

function _form_validate(&$elements, &$form_state, $form_id = NULL) {

...

elseif (!isset($options[$elements['#value']])) {
form_error($elements, $t('An illegal choice has been detected. Please contact the site administrator.'));

So it means that $options[$elements['#value'] is not set. But the feed aggregator form is set by default. I don't understand.

ParisLiakos’s picture

can you provide the opml file?

carchak’s picture

Thx for reply Paris. In the log file, it seems it's related to the category : Illegal choice 0 in Categorize news items element.
I investigate and will post the answer when fixed.

carchak’s picture

The problem seems to be a bug in aggregator with the multiple categories selection during opml import. For now I solved the problem cheking a single category during import, and updating my feeds categories after. To be deeper investigated.

bogdog400’s picture

Issue summary: View changes

I dug a bit deeper and found that the $form['values'] created by the OPML input routine is inconsistent with the one generated by the regular form.

Here's a debug message from $form['values'] generated by OPML importing:

array (
  'title' => 'blah',
  'url' => 'https://blah',
  'refresh' => '86400',
  'block' => '5',
  'category' => 
  array (
    2 => '2',
    0 => 0,
    1 => 1,
    3 => 3,
  ),
  'submit' => 'Save',
  'form_build_id' => 'form-I_AZVqvpliZXLgDvrwnn0YlGTaWjuir-8mckBSLbYmI',
  'form_id' => 'aggregator_form_feed',
  'op' => 'Save',
)

And here's a regular one that works. Notice how the array attached to category is messed up?

array (
  'title' => 'BLAH',
  'url' => 'https://news.google.com/ ',
  'refresh' => '86400',
  'block' => '5',
  'category' => 
  array (
    2 => '2',
    1 => 0,
    3 => 0,
  ),
  'submit' => 'Save',
  'form_build_id' => 'form-eOitQxomntcqizU-xCwWN0qbX21zOeteLZe-gupMTTM',
  'form_token' => '2-ukhY1QijXnCiXuxvBQdjd2c0DLTth0_Ji9jHCuiiY',
  'form_id' => 'aggregator_form_feed',
  'op' => 'Save',
) 
bogdog400’s picture

Status: Closed (cannot reproduce) » Needs work

I dug a bit deeper and found that the $form['values'] created by the OPML input routine is inconsistent with the one generated by the regular form.

Here's a debug message from $form['values'] generated by OPML importing:

array (
  'title' => 'blah',
  'url' => 'https://blah',
  'refresh' => '86400',
  'block' => '5',
  'category' => 
  array (
    2 => '2',
    0 => 0,
    1 => 1,
    3 => 3,
  ),
  'submit' => 'Save',
  'form_build_id' => 'form-I_AZVqvpliZXLgDvrwnn0YlGTaWjuir-8mckBSLbYmI',
  'form_id' => 'aggregator_form_feed',
  'op' => 'Save',
)

And here's a regular one that works. Notice how the array attached to category is messed up?

array (
  'title' => 'BLAH',
  'url' => 'https://news.google.com/ ',
  'refresh' => '86400',
  'block' => '5',
  'category' => 
  array (
    2 => '2',
    1 => 0,
    3 => 0,
  ),
  'submit' => 'Save',
  'form_build_id' => 'form-eOitQxomntcqizU-xCwWN0qbX21zOeteLZe-gupMTTM',
  'form_token' => '2-ukhY1QijXnCiXuxvBQdjd2c0DLTth0_Ji9jHCuiiY',
  'form_id' => 'aggregator_form_feed',
  'op' => 'Save',
) 
bogdog400’s picture

I dug a bit deeper. The change occurs between the last line of aggregator_form_opml_submit which reads:

drupal_form_submit('aggregator_form_feed', $form_state);

And the start of aggregator_form_feed_validate.

Somewhere in the call to drupal_form_submit, the category array is changed as above.

Version: 7.17 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.