Closed (fixed)
Project:
Linkit
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jan 2011 at 14:15 UTC
Updated:
27 Jan 2011 at 20:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
caschbre commentedI'm wondering if this has anything to do with the ajax call to lookup a node when entering an external link (or other text). I was using the linkit button to insert a link to an external site. I started typing 'http://www' and was eventually given a popup error (javascript?).
An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: http://www.foggyperspective.com/admin/linkit/autocomplete
StatusText: Not Found
ResponseText: []
Comment #2
anonThanks for the report, I will take a look at this asap
Comment #3
caschbre commentedFYI... I also don't have the book module enabled so maybe there needs to be a check before the function is called?
Comment #4
anonNeed some more info.
Regarding "Notice: Undefined index:"
Have you updated to Linkit 7.x from Linkit 6.x?
About the "http://www", I dont see what this is happeing, this works grate in D6 but it feels like they have shanged something with the menu URI stuff in D7. (And this should be an other issue I think)
Would be awesome with some help with that thanks.
Comment #5
caschbre commentedI installed linkit 7.x on a fresh drupal 7 install so there was no upgrade.
For the "http://" bit, I did a bit more testing. It's very weird. I start type 'http://' and the first letter I type after that I get the popup error. So 'http://w' throws the first error.
If you'd like I can set you up an account on my drupal 7 site that I'm using linkit on. Just use the contact form on drupal to let me know and we can sync up over IM or something.
Comment #6
anonThanks for the feedback.
Do you have any dev site? It would be grate if you could test the "Notice: Undefined index:" with the latest Linkit dev version on that because Linkit 7.x-1.0 release is very odd. Many fixes isnt included in that, I cant see why but unfortunately thats the case.
Comment #7
vitok-dupe commentedfresh drupal 7 installation with Linkit 7.x-1.0, error after typing "/", need to shield slash
Comment #8
vitok-dupe commentedanon:"It would be grate if you could test the "Notice: Undefined index:" with the latest Linkit dev version"
same...
Comment #9
caschbre commentedI installed the latest dev version and am still coming across the same issue after typing in 'http://'.
edit: I changed the version of this issue to 7.x-1.x-dev... if that wasn't appropriate let me know.
Comment #10
anon@caschbre: Its ok to change version.
This issue has two issues.
I submitted a new issue for #1024460: Slashes doesnt work with autocomplete (waiting for D7 update to fix this) so we can keep this this apart.
Comment #11
caschbre commentedSounds good.
For this particular issue... after installing the dev version I was still seeing the "Notice: Undefined index: show_books" log entry.
Comment #12
fietserwinAs already noted in #3, the fact whether the book module is enabled/disabled triggers these notices as this fact shows/hides the option on the settings form and thus saves/deletes this setting in the settings. So just changing that line of code from:
to:
prevents the notices from appearing.
Comment #13
caschbre commentedIs it better to use the module_exists function? http://api.drupal.org/api/drupal/includes--module.inc/function/module_ex...
Comment #14
fietserwinNo, you are checking a setting from the "administer linkit settings" form. If you enable the book module but do not visit the "administer linkit settings" form again it won't still be available. So just checking if it exists and has a non-empty value (exactly what empty() does) is enough.
Comment #15
caschbre commentedThat makes sense. So the empty check probably needs to be added to other settings that could technically be disabled. The taxonomy module comes to mind here.
Comment #16
anonThanks for the suggerstion fietserwin but this patch has a diffrent solution.
I have this function called
_linkit_node_get_default_settingsthat will set all necessary variables into the settings array just to get rid of all this Undefined notices.Please test this, and tell me what you think. Thanks.
Comment #17
caschbre commentedThat patch does not appear to have worked.
Also... I'm seeing the notice message eight times for each letter. Is the code cycling through that many times to throw the notice eight times?
Comment #18
anon$settings['display_settings']['show_books']is used in two line of code.43 and 94 (latest dev)
Its used once for each result you get from the node plugin.
Let say you give an "D" and get 8 results, this error should be report 9 errors.
1 for the settings where we build the SQL query, and 8 times for results (1 for each result row)
But I will look at this, to make sure its not cycling through too many times.
Regarding my patch, that should work, cant see why it woulnd. Its append all "missing" variables to
$settings['display_settings']Any idéas why this not work?
Comment #19
fietserwinPatch works for me and looking at the code it indeed should work. Stepping through with a debugger I can now see the 'show_books' element being added to the settings. And this solution looks more fool proof to me than my quick patch.
@cashbre: your remark about taxonomy module is right: same type of patch should be applied to function _linkit_taxonomy_get_default_settings(&$settings)
Comment #20
anon@fietserwin: Thanks for testing.
Do we need to change _linkit_taxonomy_get_default_settings(&$settings)?
If no settings exists in the variable DB table (variable name = linkit_term), that function should applie the missing values in the settings array. Does that fail right now?
Comment #21
caschbre commentedThe patch in #16 does work. My manual patching abilities failed me as I cut one too many lines. :-)
This looks good.
Comment #22
anonGrate, Thanks all for testing.
I will commit this when I get home today.
Comment #23
anonThanks for reporting, reviewing, and testing!
Committed to DRUPAL-7--1 branch.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Comment #24
fietserwin#20: I'm not sure as it is indeed only 1 setting. I did no test taxonomy, I just saw the same pattern applied there. The pattern being: trying to merge an array recursively (while neither += nor array_merge are recursive). So perhaps better to use the same working pattern at all places, as the moment you add a 2nd setting, this error might be reintroduced on that spot.
Comment #25
anonah I see, Ok I will do that.