Enabled Node_Type_Filter cause An illegal choice has been detected.

dracik - March 15, 2008 - 14:22
Project:Node Type Filter
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:NancyDru
Status:closed
Description

Hi,

if I enable Node_Type_Filter, and then try alter content in content admin section (/admin/content/node), like publish/unpublish, delete, etc., I got "An illegal choice has been detected. Please contact the site administrator." error. If Node_Type_Filter is disable, these actions can be made without any error.

#1

NancyDru - March 16, 2008 - 14:46
Assigned to:Anonymous» NancyDru

I will look into this, but the module shouldn't even be at play there.

#2

mooffie - March 20, 2008 - 17:54

(I'm ariving here by a post on the forum.)

I'm not using this module, but I had a quick look and I see that it uses $_REQUEST['type']. I believe this should be changed to $_GET['type'] or else --if the form happens to have a 'type' field already, which might very well be the case for the 'admin/content/node' form-- weird things could happen.

#3

NancyDru - March 20, 2008 - 18:05

Thank, Mooffie.

#4

NancyDru - March 21, 2008 - 11:49
Status:active» fixed

I was able to reproduce the problem, and Mooffie's suggestion worked. I would never have found that, so Mooffie saved me again.

Strange that this did not happen in 5.x.

#5

Open Publishing... - March 21, 2008 - 17:12

Good call, mooffie. Thanks alot.

#6

Open Publishing... - March 21, 2008 - 17:38

I just installed the 6.x-dev branch (which changes $_REQUEST to $_GET), but the bug remains. It's doesn't seem to have anything to do with the form_build_id value as I originally thought, and it seems that it doesn't have anything to do with $_REQUEST either.

I've tried dis/re-enabling the module but even after that the error message returns.

#7

NancyDru - March 22, 2008 - 00:06
Status:fixed» needs work

Hmm, I was able to reproduce the problem and it went away after the fix. Did you look at the code to make sure you got the change?

#8

Open Publishing... - March 23, 2008 - 17:44

Yes the code did change, and $_GET is now being used but the bug remains. For some reason, I am able to delete content but nothing else.

#9

NancyDru - March 24, 2008 - 14:26

Hmm. I'll do some more digging. I was able to reproduce the problem and was able to do everything after fixing it.

#10

Open Publishing... - March 30, 2008 - 08:05

Hi. Just letting everyone (especially nancyw) know that the new version -does- now work for me. I don't know why it continued to act buggy for a while after being updated. Maybe it had something to do with caches or some other obscure Drupal tomfoolery 8)

Anyway, it's working now, and it does seem to be as a result of the $_REQUEST fix. Good work everyone and thanks alot.

#11

NancyDru - March 30, 2008 - 13:20
Status:needs work» fixed

Great, thanks for the update.

#12

Open Publishing... - March 30, 2008 - 22:03

update:

Now it's not working again. Very strange. I have tried uninstalling/reinstalling the module and still have the problem.

#13

NancyDru - March 31, 2008 - 01:31
Status:fixed» needs work

#14

Open Publishing... - March 31, 2008 - 14:21

I saw that you just changed the status to fixed. It turns out I am still having the problem after all. I don't know why the bug subsided briefly, but it's back.

#15

NancyDru - March 31, 2008 - 15:09

I cahnged it to fixed when you said it was working. When you then said it was not, I changed it to PCNW.

#16

NancyDru - March 31, 2008 - 15:29

I just did this with multiple nodes, using "publish," "unpublish,", "promote," and "delete." They all worked fine.

Are you using an access control module or something else that also uses hook_db_rewrite_sql?

#17

Open Publishing... - March 31, 2008 - 16:27

I previously had node_type_filter installed in my .../sites/all/modules/node_type_filter directory. Despite updating the module in that directory, the bug remained.

I just realized that .../sites/all/taxonomy_browser contains its own copy of /node_type_filter, presumably the version that still had the bug.

Hopefully if I update the .../taxonomy_browser/node_type_filter directory with the new version of the module, the bug will be fixed completely. Right now I am having hosting issues and so cannot test this, but I will report back shortly.

#18

NancyDru - March 31, 2008 - 22:25

Did you put that extra copy there, or did it somehow get distributed that way?

#19

Open Publishing... - March 31, 2008 - 23:50

I'm fairly certain I put that copy there accidentally.

I completely removed Taxonomy Browser and Node Type Filter (both copies), and then reinstalled each. Still receiving the error.

I wouldn't be too concerned though. It seems that the fix is working for everyone else. More than likely, I am either doing something wrong or broke Drupal in some way (maybe with another module or theme). I'm more than willing to help you in whatever way possible, but like I said it seems that this bug is now unique to me.

#20

NancyDru - April 1, 2008 - 00:21

Well, I have no idea how many "everybody else" is - as far as I know you and I may be the only ones using it. So that makes you important.

So let's start with the $Id line in the module. And verify that this change got made to your current copy, please.
My code shows v 1.2.2.1.2.2.2.2 2008/03/21.

#21

Open Publishing... - April 1, 2008 - 00:54

Success!!!

Apparently I have been using v 1.2.2.1.2.2.2.1 2008/01/25 19:32:14 during my testing today. This is the version which is available for download on the module's page, http://drupal.org/project/node_type_filter.

After manually changing $_REQUEST to $_GET, everything now works perfectly!

It seems that I was encountering two problems here, $_REQUEST and the multiple copies of the module. A couple of weeks ago I fixed $_REQUEST, but that edit was apparently reversed when I reinstalled the module (unknowingly to 1.2.2.1.2.2.2.1). It wasn't until just now that BOTH problems were corrected. As such, it wasn't until just now that the problem was completely resolved.

Thanks for keeping in contact with me and working with me to get this issue resolved. Keep up the great work...and fix that link!

"given enough eyeballs, all bugs are shallow"
-Eric S. Raymond, Open Source Software advocate

#22

NancyDru - April 1, 2008 - 02:23

Oh, I guess I wasn't clear. When I make changes, they are always to the -dev version. After I've made a few changes and people have tested them, then I roll up a new official version. Please try the -dev version.

#23

Open Publishing... - April 2, 2008 - 00:40

Yes, the -dev version seems to work great. Sorry about the confusion.

#24

NancyDru - April 2, 2008 - 01:02
Status:needs work» fixed

Great.

#25

Anonymous (not verified) - April 16, 2008 - 01:02
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.