"Add another item" button doesn't work when url rewriting enabled.

Domug - October 22, 2009 - 22:03
Project:Content Construction Kit (CCK)
Version:6.x-2.5
Component:General
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm using drupal 6.14 on a 1and1.fr server. I have installed CCK 2.5 and Filefield / ImageField 3.2, with url rewriting enabled.
Steps to recreate the bug :
- create a new content type 'test_type', add a field text field 'field_test_field', allow multiple values, save
- goto create new content 'test_type', before submiting the new node, click on the 'add another item'. This won't work on my installation when url rewriting enabled. I get a popup saying 'error HTTP 404 :
/content/js_add_more/test_type/field_test_field'
when i disabled url rewriting the button works as expected and adds another item.

my rewrite rules in case it might help you find the error :

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

#1

markus_petrux - October 23, 2009 - 06:58
Category:bug report» support request
Priority:critical» normal
Status:active» postponed (maintainer needs more info)

What do you mean by "url rewriting enabled"?

If this is related to another module, then that module is probably doing something wrong.

If you mean "Clean URLs enabled", then I think there's something odd in your installation because this feature works on many other installations.

#2

Domug - October 23, 2009 - 22:33

actually i mean "url rewriting enabled".
the thing is that it worked fine until i updated to drupal 6.14 and views 2.5 and / or filefield 3.0

#3

markus_petrux - October 24, 2009 - 11:27

hmm... "url rewriting enabled" is the stuff in the .htaccess that's required by "Clean URLs" in Drupal, so I guess we're talking about the same thing.

Well, this is something that works on lots of sites, so it seems there's something odd in your installation.

Try to see what happens using one of the following URLs entered directly in the browser address bar:

http://www.example.com/index.php?q=content/js_add_more
http://www.example.com/content/js_add_more

You should see something like the following:

{ "data": "" }

#4

Domug - October 24, 2009 - 16:36

thanks for trying to help me out !!

i tested
http://www.example.com/index.php?q=content/js_add_more
and it returns { "data": "" }

but this :
http://www.example.com/content/js_add_more
returns

Not Found

The requested URL /content/js_add_more was not found on this server.
Apache/2.2.3 (Red Hat) Server at www.example.com Port 80

#5

markus_petrux - October 24, 2009 - 20:18
Status:postponed (maintainer needs more info)» fixed

So it seems your rewrite rules are being ignored for some reason. This is not a problem with CCK itself, but something related to your site configuration. CCK does not touch .htaccess files and anything related to that. I marking this support request as fixed because it is not related to CCK.

Maybe there is something in your system that has altered your mod_rewrite rules, or your .htaccess file has been corrupted.

#6

Domug - October 25, 2009 - 17:53

i have been able to identify the problem : i had a file called "content.swf" in the drupal base directory.

one of the following conditions made apache skip the rewrite process when navigating to /content/js_add_more/:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

my conclusion : don't have files beginning with things like "content", "node" or "services" in the root directory when you're using apache rewrite and "clean urls"( at least on 1and1 servers)

#7

System Message - November 8, 2009 - 18:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.