Closed (fixed)
Project:
Flag
Version:
6.x-1.3
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2009 at 01:20 UTC
Updated:
14 Jun 2012 at 15:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jacobthetopdawg commentedI'm experiencing the same error using IE 8 when trying to flag content. Any ideas anyone?
Comment #2
mooffie commentedWhen "An HTTP error 200 occurred..." shows up it usually because of some PHP error on your site. (One other possible reason: doing a page redirection upon flagging.)
To see the actual PHP error, open the link in a new window (or tab).
In other words:
Don't click the flag link with your left mouse button. Instead, click it with your right mouse button. Then, using the context menu, open the link in a new tab/window. The page you'll see will probably reveal something about why the error occurred. Please report back the result.
Comment #3
matt v. commentedIt looks like it might be a Views issue:
Comment #4
mooffie commentedNote that the 'fid' on the right side of the "=" is missing. This could happen if the flag doesn't exist.[1]
Examine the view. (Go to its editing screen.) Inspect all the flags names you see there (e.g. "bookmarks", "friends"; in the relationships), and make sure you haven't deleted any of them. It's certainly possible to have a view that reference flags that no longer exist ...this would generate the faulty SQL you saw.
-----
[1] But, then, taking $flag->fid would trigger a PHP warning ("Trying to get property of non-object")... it's interesting that you didn't report this. Maybe because the "official" Drupal doesn't alert of these warnings. I suggest you have a look in your watchdog log.
Comment #5
matt v. commentedI only have one flag field under the relationships section. I tried removing it, but that breaks the view. When I added it back in, I still received the error message in comment #3.
I tried deleting the bookmark flag that I think comes bundled with the flag module, just in case, and I still got the error. I also tried removing the exposed filter I had set up for the flag, and I still got the error.
On the off chance that it might help, I've exported the view and I'm attaching it here.
Comment #6
jacobthetopdawg commentedI opened a new tab as suggested, but it appears the flag went through ok with no mysql errors. However, when I try to just click on the flag link in the same window I get the HTTP error 200 message. You mentioned the problem could be a redirection issue. My link is looking like this:
http://192.168.1.100/drupal4/flag/flag/plus_favorite/270?destination=nod...
Could there be a problem in my links?
In FF, the flags work :( .
Comment #7
febbraro commentedFor what it is worth, I have seen this issue (the error in views join) when I have a relationship to a flag that does not exist, or exists with a different name. The views relationship looks up flags by name. One way to figure out what is happening is to export the view and look at which flag name it is trying to join and verify that flag exists and is enabled.
Good luck.
Comment #8
mooffie commentedPerhaps yours is a jQuery issue. Could you upgrade your jQuery and report back? (Use the '-dev' version of jquery_update, because its jquery is newer.)
Comment #9
mooffie commented@Matt,
Comment #10
cangeceiro commentedI am also getting similiar behavior from my site when I try to add a "Flagged Link" field in a table view. I'm using firefox, and and it throws an error when i click on add. the error is "An error occurred at http://192.168.1.34/admin/build/views/ajax/add-item/requests_marketing/d...."
If i copy that link into my browser and try to access it, i get a return with no errors. Also, if i refresh the page, it ads the field to my lists of fields. but the field isnt actually displaying anything in the table.
I would lean against this being an issue with a missing flag, as I only have 1.
Comment #11
cangeceiro commentedI found my problem...if its related. This appears to be a bug in views. I was able to fix mine by upgrading to 6.x-2-dev
Comment #12
mooffie commentedCangeceiro, thank you for the report.
Once somebody corroborates this we should put this info on Flag's homepage.
Comment #13
matt v. commentedI just tried upgrading to Views 6.x-2-dev and it didn't fix the problem for me. I'm going to try recreating the view from scratch when I get a little more time. I'll report back.
Comment #14
mooffie commentedComment #15
pdcarto commentedNot sure if this is related, but when try to put a flag link into a node view where I'm using node id as an argument, the SQL includes a field 'users.nid', which throws a SQL error because users has no nid field.
Comment #16
cangeceiro commentedstrangely this problem came back for me. but in a slightly different form. after upgrading to the dev version of views it worked for a day, and just this morning i started getting "Fatal error: Call to a member function get_views_info()" I have opened an issue on the views project at http://drupal.org/node/450690
Comment #17
jacobthetopdawg commentedIn response to #8:
Jquery update with -dev version introduced other issues for me. ie broke ajax comments and broke fivestar module. I did notice that flags were going through, but without ajax animations. I'll keep investigating.
Comment #18
mooffie commentedMarking this 'critical'.
As for the "HTTP error 200" alert box: It's a mystery because I don't see why any Views code gets called when one just clicks an ajaxy flag link.
Comment #19
mooffie commentedHey... perhaps Views erroneously attaches a Javascript click-handler to Flag's links when the view's AJAX support is turned on? I see that Views does
.find('ul.pager > li > a, th.views-field a, .views-summary a')so Views is not supposed to pick up our links, but who knows. I can't check things further as I'm not running Drupal.Could anybody turn off the view's AJAX support and see if it solves the "HTTP error 200" alert box problem?
Comment #20
matt v. commentedmooffie,
If you mean the "Use AJAX" option under the "Basic settings" section of the view, that was already turned off for the view I've been having trouble with. Just to be thorough, I tried turning off Javascript using the Web Developer Toolbar for Firefox and I still got the error message.
Comment #21
mitchell commentedmerlinofchaos said in #450690: Fatal error: Call to a member function get_views_info() mentioned in #16:
Agreed, this is critical:
Comment #22
ebeyrent commentedI also have this issue as described in #16. Any luck on solving it?
Comment #23
ebeyrent commentedRegarding #16, I found that when I had my flag configured to use multiple content types, I got the fatal error. When I removed the second content type, everything worked as expected.
Comment #24
boreg commentedI found solution :)
Its simple. U have to enable that flag u use in views. I mentioned it here: http://drupal.org/node/450690#comment-1796822
Comment #25
quicksketchI've never been able to reproduce this bug, but the solution posted by boreg in #24 sounds likely to be a fix. Sounds like a problem with flag_friend specifically creating a default view and a default flag that is disabled. Since a new version of Flag Friend has since been released, that might explain why the bug reports slowed or stopped. Unless there is some confirmation that boreg's solution does not fix the problem, I think we can close this issue.
Comment #26
quicksketchClosing after lack of response.
Comment #27
matt v. commentedI've updated to the latest version of Views (6.x-1.8) and I'm still getting essentially the same error as in #3. In comment #24 above, is that referring to the "What nodes this flag may be used on" setting for the flag? If so, I have that set.
Can anyone help me pinpoint where the right-hand side of the "flag_content_users.fid =" argument gets set?
Comment #28
quicksketchMatt V: Could you provide steps to reproduce this issue, or post an export that is very, very simplistic? The export you posted above seems complicated to reproduce, needing VotingAPI and custom node types and flags. It'd help to be able to easily reproduce this problem, as it is I'm not sure how to fix something I can't see.
Comment #29
matt v. commentedquicksketch,
Thanks for the quick response. Here is a simplified example that still exhibits the issue.
Comment #30
Bilmar commentedI have come across this issue, and hoping that someone found a fix.
Flag 6.x-2.0-beta1
Views 6.x-2.8 / 6.x-2.x-dev / Views 6.x-3.x-dev (2009-Dec-29)
Flagging a node once on the view seems to be ok.
The error appears when you try to unflag or flag another node listed in the view (the second call of the flag action).
An HTTP error 200 occurred.
http://www.example.com/flag/flag/wishlist/9?destination=search&token=b58...
Comment #31
Bilmar commentedadditional information
Fatal error: Call to undefined function activity_record() in /home/example/public_html/includes/actions.inc on line 100
Browsers tested: Firefox and IE results in same error
Views AJAX: Yes and NO results in same error
Flag Link type: JavaScript toggle and Normal link results in same error
Error occurs when the flag/unflag action is clicked two times for the same node.
Example steps 1: flag Node 1, flag Node 2, flag Node 3, flag Node 4 [ALL OK, no errors]
Example steps 2: flag Node 1, unflag Node 1 [ERROR, however after page refresh Node 1 is unflagged]
Example steps 3: flag Node 1, flag Node 2, unflag Node 1 [ERROR, however after refresh Node 1 is unflagged]
However, after the error I refresh the views page and the Node that resulted in error from flag/unflag has been flagged/unflagged even though the error made it seems like nothing happened.
Please let me know if more information is required. Thanks in advance!
Comment #32
Bilmar commentedTurning ON the Activity module fixed the error. This is odd as I don't wish to use the Activity Module.
This would make it seems like the Flag Module is dependent on the Activity Module?
Comment #33
robby.smith commentedsubscribing - is this still an issue in the latest dev?
Comment #34
matt v. commentedI did some cleanup of extraneous views on my site and oddly enough that seemed to resolve this issue for the remaining views. I even tried re-importing the simplified view I had exported for comment #29 above and that too worked fine after the cleanup.
Comment #35
Cousken commentedI had the same problem, and many more very similar, but they only affected admin account. I've tried a lot of troubleshooting and in the end i found out they were caused by Theme Developer module, they all disappeared when i disabled the module.
Check if the problems persist if you use a normal Authenticated User account, if they don't it is likely that Theme Developer is causing it, just like in my case.
Comment #36
quicksketchSounds like (once again) this is an issue caused by other modules breaking AJAX requests rather than a problem with the module doing the AJAX. I don't believe this is a problem with Flag, and unless someone can create this problem from scratch on a fresh Drupal install, I don't think there's anything that can be done on our side.
Comment #38
Anonymous (not verified) commentedIn case people keep having this problem,
watch out for the search404.module - I got "access denieds" on /flag/flag pages causing "HTTP ERROR 200" on js flags. Disabling the 404 module restored flags.
Comment #39
scrimothy commentedI'm running:
Drupal 6.19
Flag 6.x-1.3
I did not use Views for this particular node/page. I just added the flag_create_link() function to my node.tpl directly. I get the 200 error window, but when I click OK, and then refresh the page, the "Bookmark this" turns to "Unbookmark this" as it should and the user/%/bookmarks page shows the new node in the bookmark list (and vice versa for unbookmarking).
When trying other suggestions (i.e. right-click/open in new tab) all works well and I just redirect perfectly back to the original page with the bookmark link toggled the way it should. Also, same thing happens if I turn off JS (in Google Chrome and FF)...redirects fine through the bookmarking and back to the original page. Also, if I copy and paste the URL that is shown in the error window (http://example.com/flag/flag/bookmarks/18?destination=node%2F18&token=...), then again, it handles everything fine and toggles (changing "/flag/flag/" to "/flag/unflag/" as a toggle). It must be all about the JS that is an issue.
I can't seem to find an actual answer to this (or a patch/work-around). Has anyone figured this out or added a new fix for this issue? Thanks sooooo much!
Jimmy
Comment #40
dbers commentedI'm getting the same error. It looks like its an issue with changes made for jQuery 1.4 (http://api.jquery.com/jQuery.ajax/)
The json object being returned by the function isn't perfectly formated, there for 1.4 jquery throws an error.
I quick fix was to do adjust the flagClick() function in theme/flag.js
make this line:
dataType: 'json',
success: function (data) {
something like this:
dataType: 'text',
success: function (tmpData) {
data = jQuery.parseJSON(tmpData);
I don't believe this is an error with Fag module though, since it uses drupal_to_js() to return the json .
Later version of php (5.2+) can just use json_encode but earlier version needs a drupal_to_js thats stand
Comment #41
micnap commentedDitto #39. HTTP Error 200 in IE7, FF 3.6, and Chrome 9.0. I tried doing what dbers suggested and it takes away the error alert but the little blue arrow just spins and never resolves although the flag does still get added/removed.
This is with a default install of flag using the bookmarks flag.
Running PHP 5.2.14.
Thanks,
Mickey
Comment #42
micnap commentedUpdate: The error is being caused by a widget on the page using http://code.jquery.com/jquery-latest.js. Reverting this back to jquery 1.3.x gets rid of the flag js error but then kills my widget. Don't know enough javascript to resolve it so I guess I'll be using the normal link instead of the javascript toggle.
Mickey
Comment #43
dbers commentedWhats your widget do?
I had upgraded to jquery 1.4 for jQuery Tools plugin.
But the 1.4 jquery was causing issues with the admin theme as well so i found an older version of jQuery Tools that could do what i wanted.
Perhaps look into doing the same thing (down grading your jquery)
Comment #44
darnzen commented#39 above is what I'm seeing.
Here are the things I've tried (unsuccessfully) to try and resolve it:
Upgraded Drupal 6.20
Upgraded to Flag 6.x-2.0-beta5
Upgrading jQuery with jQuery-update module
Downgrading jQuery back to 1.2.6
Disabling many other modules, including views, quick tabs, global redirect, pathalias_xt, etc. etc.
Verified problem exists with user flags, node flags with multiple content types, node flags with single content type, default bookmarks flag, and global flags.
I did NOT disable CCK, content_profile, taxonomy, image_cache, and other basic functionality modules that I needed to even test the problem. All of these modules are up to date and 'green' on the update admin report.
Verified problem exists on IE8 and Chrome 11.0.696.60 beta, and Chrome "stable" release (can't remember the version number since I switched back to beta). I seem to remember it working on Firefox at one point, but for some reason I can't get FF to load any JS atm.
Oddly, I can't find the http:200 error logged anywhere. It's not in my apache log, mysql log, drupal watchdog. Even having the java console open doesn't show any errors.
Also, everything works fine without the JS toggle enabled. All the other JS on the site works fine.
HTTP: 200 is supposed to be successful "OK" code isn't it? At least according to http://en.wikipedia.org/wiki/List_of_HTTP_status_codes and http://www.w3.org/Protocols/HTTP/HTRESP.html
Maybe the problem is in the JS error handling?
Comment #45
ReKoNe commentedI have the same issue.
Following #2, i can see this error :
"Fatal error: Call to undefined function flag_reset_flag() in /www/sites/all/modules/flag_abuse/flag_abuse.module on line 70"
I am using "Flag 6.x-1.3" and "Flag Abuse 6.x-2.0-rc1"
Comment #46
titouilleHello,
Updated from drupal 6.20 to drupal 6.22, same problem with http 200 error.
I have a modified version of jquery-update to get 1.4.2 in front site.
In include/common.inc, the drupal_to_js function is changed in 6.22. In 6.20, it use the json_encode method and it works fine :
But in 6.22, there is a recursive method like this :
And the return of this method is strange, embed with "[pre]...[/pre]" and with a space before the result, ie :
With #40 and using eval( '(' + tmpdata + ')' ) instead of jQuery.parseJSON(tmpData) it works fine with jquery 1.4.2.
Hope this can help.
Comment #47
llorberb commentedI have the same issue, but only when I am using tokens in the link text. Any suggestions.
Comment #48
wm753v commentedSame issue, but I solved it. In my case, I had added a javascript reference in my .info file:
scripts[] = scripts/jquery1.2.6.tools.min.js
When I removed this jquery reference it worked. The problem is, I need that jquery, so I'm looking for a solution for that now.
By the way, you can try using the different options on the Flag configuration page:
Link type:
JavaScript toggle
Normal link
Confirmation form
and try "Normal Link". If "Normal link" works, it would seem to suggest there is some javascript issue.
Comment #49
omar alahmedI have the same issue, but I solved it by removing an additional jquery I added it for a plugin.
Comment #50
navi85sin commentedIn my case, i just installed the jquery update module and it works.