hello,
i've make a view of node and i've put in the row the "Content: Flag lists operations (Flag lists operations)"

everything seems to work fine but when i create a new list from the ui dialog and I select this new list in the combo, the node is inserted correctly in the list, but it generates the error:

"An illegal choice has been detected. Please contact the site administrator."

I've seen the issues of Flag module (7.x-2.0) but my version is patched and the error persist.

In the log report i've find this: Illegal choice 37 in flag_lists_flag element.

Any idea?

Comments

enricotersi’s picture

Problem solved. I added # validated '=> TRUE

$form['flag_lists_' . $form_state['flo_operation']]['list'] = array(
        '#type' => 'select',
        '#options' => array('0' => t('- ' . $null_text . ' -')) + $items,
        '#default_value' => '0',
        '#validated' => TRUE,
        '#ajax' => array(
         'callback' => 'flag_lists_ops_form_ajax_callback',
         'wrapper' => 'flag-list-ops-container-' . $flo->options['flo']['operation'],
        ),
        '#attributes' => array(
          'class' => array(
            'flag-lists-ops-dropdown',
          ),
        ),
      );

may be it the correct solution?

mcfilms’s picture

Issue summary: View changes

Hi enricotersi,

I have run into precisely this same issue. Did you add that code to your own custom module? or did you make changes to the existing Flag Lists module? I would like to do the same and I am wondering if you can offer some guidance.

Thank you,

Jerry

alimbert’s picture

I modified the original module with this code and it does fix. But the only difference is that '0 item(s) added to...' whether i have this coding added or not. Any idea why a user wouldn't be able to add items to their own list?

mcfilms’s picture

I can also confirm that adding enricotersi's code to the module gets rid of the error. I wish there were a way to bring this to the attention of one of the maintainers.

However, I am having the exact same problem as alimbert above. In my case, I have a views-generated list of node titles and fields. I added a "Flag lists: User" relationship as was suggested in the documentation. But whenever a user tries to add items to any of their user lists, they get the '0 item(s) added' message.

By the way, this is working correctly for the super-user. As an admin I can add items to lists all day long. But other registered users cannot. I have given these users every single permission related to Flags and Flag Lists, so I am at a loss as to why it is not working.

Any ideas?

sl27257’s picture

Status: Active » Closed (outdated)