It's happening to me with the book module.

I have created a group named 'nobody' (no role assigned).
Then I create a book page and I do not select the group 'nobody'. Saves ok.
Then I try to edit that book page and when I press 'preview' I get the message "Illegal choice in .".
When updating the page, if I check 'nobody', the book page is saved ok, but is obviously not what I need.

I think there are 2 problems here.

1) Probable the forms api should be telling me which field is "illegal".
2) Maybe the way the default values are built here could be changed so it works ok.

It is strange that I was able to create the book page, but I can't update it.

CommentFileSizeAuthor
#1 simple_access_1.patch1.47 KBmarkus_petrux

Comments

markus_petrux’s picture

StatusFileSize
new1.47 KB

I believe I've found the solution. In the edit page (of a node) when no simple_access group was checked, gid for that node in 0. In this case the default_values of the form should not be set.

Please, see attached patch. Oh, it also set $weight = 0; as default value when creating groups.

chrisd’s picture

I think I had this problem.

I looks like the nodes that existed before "Simple Access" was installed could not be updated (Error "Illegal choice in .").
The work around for me, was to pick a "Only viewable by" role, save, reedit and then remove the that role.

I installed your patch and it looks like the pre-"Simple Access install" node now can be updates without doing the previous trick.

Should we update the package ?

Thanks markus_petrux,

Christophe D.

markus_petrux’s picture

Status: Active » Needs review

I've been using that patch with no problems. :-)

I believe I forgot to flag the issue for code review. :-?

Tobias Maier’s picture

Status: Needs review » Reviewed & tested by the community

thank you very much for your patch it works as expected

I set it to rtbc and hope jjeff would commit it soon :)

cu tobi

Tobias Maier’s picture

Status: Reviewed & tested by the community » Fixed
jjeff’s picture

My apologies for not getting to this sooner. The patch has been applied to the 4.7 and CVS versions Simple Access.

Still working on 4.6...

tayknight’s picture

Thanks, markus. I was pulling my hair out :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

  • Commit 3592d0d on 5.x-1.x, 5.x-2.x, 6.x-2.x, master, 8.x-3.x by jjeff:
    #45819 by markus_petrux fixes "illegal choice" problem