I've got a content type called "video" with the number of items set to "unlimited"
When I click "Add another item" I get the following error which prohibits upload. I can save the node, hit edit, then add another item, however, the javascript is broken. Tested IE, and FF on Windows and Ubuntu:
An error occurred.
/content/js_add_more/video/field_emvideos
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Quixote Center | Come Dream With Us</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/sites/qc/files/favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="/sites/all/modules/fckeditor/fckeditor/fckeditor.js?I"></script>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/views/css/views.css?g" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/qc/files/css/css_959341d125891f9caf0bf35b4876d343.css" />
<script type="text/javascript" src="/sites/qc/files/js/js_254a2cd2b86b20f676ba8f9f69784269.js"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "googleanalytics": { "trackOutgoing": 1, "trackMailto": 1, "trackDownload": 1, "trackDownloadExtensions": "7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip" }, "lightbox2": { "rtl": 0, "file_path": "/(\\w\\w/)sites/qc/files", "default_image": "/sites/all/modules/lightbox2/images/brokenimage.jpg", "border_size": "10", "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": "0.8", "overlay_color": "000", "disable_close_click": 1, "resize_sequence": "0", "resize_speed": 400, "fade_in_speed": 400, "slide_down_speed": 600, "use_alt_layout": 1, "disable_resize": 0, "disable_zoom": 0, "force_show_nav": 0, "loop_items": 0, "node_link_text": "View Image Details", "node_link_target": 0, "image_count": "Image !current of !total", "video_count": "Video !current of !total", "page_count": "Page !current of !total", "lite_press_x_close": "press \x3ca href=\"#\" onclick=\"hideLightbox(); return FALSE;\"\x3e\x3ckbd\x3ex\x3c/kbd\x3e\x3c/a\x3e to close", "download_link_text": "Download Original", "enable_login": false, "enable_contact": false, "keys_close": "c x 27", "keys_previous": "p 37", "keys_next": "n 39", "keys_zoom": "z", "keys_play_pause": "32", "display_image_size": "",
All my "add another item" buttons on my content types are likewise borked.
This may be related to this issue. However, clean urls work for me, and I pass the tests listed in comment #4.
This may be a support request, like the above issue. If so, thanks much for your help.
I recently added some rewrite rules to my .htaccess, however, removing the custom rules below has no effect on the above error.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^haitireborn\.org$ [NC]
RewriteCond %{QUERY_STRING} ^q=node/([0-9]{3})$ [NC]
RewriteRule ^.*$ http://quixote.org/index.php?q=node/6%1 [R=301,L]
RewriteCond %{HTTP_HOST} ^haitireborn\.org$ [NC]
RewriteCond %{QUERY_STRING} ^q=node/([0-9]{2})$ [NC]
RewriteRule ^.*$ http://quixote.org/index.php?q=node/60%1 [R=301,L]
RewriteCond %{HTTP_HOST} ^haitireborn\.org$ [NC]
RewriteCond %{QUERY_STRING} ^q=node/([0-9]{1})$ [NC]
RewriteRule ^.*$ http://quixote.org/index.php?q=node/600%1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(haitireborn\.org)$ [NC]
RewriteRule !^.*node.*$ '-' [C]
RewriteRule ^(.*)$ http://quixote.org/haiti/$1 [R=301,L]
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedRe: "I've got a content type called "video" ..."
Is this related to the Video module? If so, the problem could be caused by that module.
More questions:
- Does the "Add more items" button work in other content types with fields such as Text, Number or Node reference?
- Could this issue be caused by any other module?
- Is there any javascript error reported?
- Anything in Drupal logs, Apache logs?
We need a step by step procedure to reproduce the problem. Otherwise, it is not possible to guess what's going on.
Comment #2
glass.dimly CreditAttribution: glass.dimly commentedmarkus_petrux,
Thanks for your careful response. I would greatly appreciate some advice as to what you think this problem might be related to, even if it's not CCK.
1. Error is reproducible on my site with "add another item" button on a content type that has just a single line text field with an "add another item" on it
2. This issue is likely not caused by the emfield module because of the above point
3. No javascript error reported through firebug
4. Ah, yes, there is an error log, thanks for asking me to check. This is no doubt quite illuminating. It appears to be a views error, but why this would appear on a node creation form, which has nothing to do with views, I have no idea.
Any idea?:
Comment #3
glass.dimly CreditAttribution: glass.dimly commentedBelow is the views function to which the above refers. I'll gladly shift this to the views queue, but in tracking this issue down, can you tell me why a views function related to paging for the content/js_add_more is being called here? Is CCK doing this, or is this some other issue?
Comment #4
glass.dimly CreditAttribution: glass.dimly commentedComment #5
markus_petrux CreditAttribution: markus_petrux commentedIt looks like there's a view that's taking over the path used by the AHAH callback of the "Add more items" button. Hence, the problem.
In addition to this, it looks like the second argument of the path is being passed to the view as-is, This is a critical issue as it could lead to SQL Injection.
You should identify the view by inspecting the query you see in the error, or by looking at the path. Then try to identify who's using that view and disable until these issues are fixed.
Nothing related to CCK itself, so switching issue category to support request, and marking it fixed here.
Comment #6
glass.dimly CreditAttribution: glass.dimly commentedmarkus_petrux,
Thank you very much. There was a view who's path was content/.
I changed the path and the problem is gone.
Thanks for your eyes on this issue.
glass.dimly
Comment #7
glass.dimly CreditAttribution: glass.dimly commentedI added numeric validation on that view. I was using the default, basic validator for the view.
Though I would assume that the basic validator would filter out SQL injection. Is this not the case?
Comment #8
glass.dimly CreditAttribution: glass.dimly commentedMoved this issue to the views queue.
http://drupal.org/node/652666
Comment #10
liquidcms CreditAttribution: liquidcms commentedsorry to re-open.. but... i have same error for any multi field type when i select Add Another Item i get popup window with the error:
disabling the devel module and the issue goes away and i now get my added item.
views is not enabled.
Comment #11
shunting CreditAttribution: shunting commentedI had the same problem (except my JS alert was a whole lot longer). When I turned off devel, the problem went away.
Comment #12
nruest CreditAttribution: nruest commentedI am having a very similar problem with the "Add another item" button. When the button is clicked on any field that has the button, I get a popup display message that says, "The page at example.ca/ says: An error occurred. /content/js_add_more/war-letters/field_creator (no information available)."
I have tried all of the solutions here, but all to no avail.
1. No Views have '/content' in the path
2. Devel module - disabled, uninstalled
3. Rewrite is not a problem - http://example.ca/content/js_add_more/content_type_name/field_name_example returns: { "data": "" }
There is nothing in the Drupal log, or apache log hinting to a problem/solution.
Any ideas?
Thanks!!!
Comment #13
nruest CreditAttribution: nruest commentedProblem found - RDF module.
RDF was appending the following to the ajax response: "xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="dcterms : http://purl.org/dc/terms/ "
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
Comment #14
deltab CreditAttribution: deltab commented@nruest, did you solve it?
Comment #15
itsnotsohot CreditAttribution: itsnotsohot commentedI am having a similar error to the above on my site. I have a content type class with fields referencing other content types (skills, people, etc.)
Now when trying to add additional items to these unlimited fields I get "An HTTP 0 error occurred. www.mysite.com/content/js_add_more/class/field_related_events (or other names, depends on the field of course). This appears to be a page level error, nothing appears in the recent log entries.
Any ideas on next steps?
Thanks!
Comment #16
sgwood CreditAttribution: sgwood commentedI had the same error i.e. content/js_add_more http error 403
when clicking on the "Add another item" button of a CCK field
set to unlimited.
The error only apeared for another user. i.e. a non-user/1 user.
The solution was to give the User Role "access content" in Permssions
under "access content". The user could then use the "Add another item" button.
The drawback of this is that users of this role will now
be able to view all Content Types when creating content.
I wanted to avoid that but this bug seems more critical.
Hope this helps someone.
My build: Drupal 6.22, Content 6.x-2.9, Views 6.x-2.12
Comment #17
dblankman CreditAttribution: dblankman commentedAfter at least six months of working correctly, the add more now gives and error message of: An error occurred.
/europe/content/js_add_more/enveurope-metadata/field_person_first_name
(no information available).
This problem occurs with any Add Another Item regardless of the CCK content type. Unlike the first poster, saving a node does not allow adding another. Clicking on Add Another while editing a node produces the same error. This problem occurs even with administrator role.
going to the URL http://enveurope.geocatalogue.ise.cnr.it/europe/content/js_add_more/ yields
"data": "" }
any help in tracking down the source of the problem would be appreciated.
Comment #18
simon.fryer CreditAttribution: simon.fryer commentedSame as above. Having been working for months, and apparently out of the blue, i now get the error as described above.
I've disabled Devel, with no luck, my permissions are all good.
Any ideas?
Comment #19
simon.fryer CreditAttribution: simon.fryer commentedI now actually get this with a repeatable link field, so not even a content group? Again, completely randomly broken.
Comment #20
simon.fryer CreditAttribution: simon.fryer commentedI've had a look around, and randomly ended up in includes/common.inc at line 1421, the url() declaration.
I changed
Too;
And instead of an error, all the fields within that unlimited field get set to "____", four underscores.
This is where i end up getting stuck. Anyone got any further ideas on this?
Comment #21
simon.fryer CreditAttribution: simon.fryer commentedHad been a long day!
With the correct replacement for the "+=";
$options['fragment'] = '';
$options['query'] = '';
$options['absolute'] = FALSE;
$options['alias'] = FALSE;
$options['prefix'] = '';
I still get underscores, although a multigroup does add in again now, but the form is all over the place, and a random underscore in the centre, the image doesn't float right, fields are wrapping wrong etc. This happens for the added item, as well as the previous items.
And the link field just gets replaced with some underscores, including the previous entries.
Although i am on 6.x-3.x-dev - do i need to create a new bug report?
Comment #22
simon.fryer CreditAttribution: simon.fryer commentedFIXED IT. Holy shit.
As it turns out, apologies to module maintainers, something within our theme is 'causing it go awry.
All i've done, after literally looking at this for around 2 months on and off, here's my fix - which is solely configuration.
- Browse to 'Site configuration', 'Administration tools' then hit 'Administratio theme'. (admin/settings/admin/theme)
- Expand 'Pages' if not already
- Expand 'Custom pages'
- Add in this one line; 'content/js_add_more/*' (without quotes)
- Voila!
Comment #23
elgrincho CreditAttribution: elgrincho commentedI had the same issue and just turned off one module after another. Disabling botcha-module fixed it for me.