Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Original comment http://drupal.org/node/1022940#comment-3933186
I'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 | File | Size | Author |
---|---|---|---|
#22 | 1024460.patch | 850 bytes | swentel |
#7 | linkit.1024460.patch | 2.35 KB | anon |
Comments
Comment #1
caschbre CreditAttribution: caschbre commentedDo the slashes not work with any autocomplete within drupal or just the linkit autocomplete?
Maybe the UI just needs to be broken up (i.e. two tabs) to allow a standard textbox for external links and a search tab for linking to internal content. This also reduces ajax calls when someone is entering external links.
Comment #2
anonTryed to enter slash into Authored by field for a node now, and that also throws the same error msg.
Since this is working in D6, or at least the autocomplete stops searching when a slash is given in Linkit, Im quite sure that this can be fixed here too, but Im not 100% sure.
I think this has something todo with the paths in hook_menu.
linkit/autocomplete is becoming linkit/autocomplete/sometext/whatever where [sometext/whatever] is given.
Another weird thing is that if Im giving just a dot (.) this freaks out in Linkit, but not in Authored by field.
Comment #3
vitok-dupe CreditAttribution: vitok-dupe commentedSeems that this is drupal core bug, because if typing slash in default tags field, it's giving same error.
Comment #4
vitok-dupe CreditAttribution: vitok-dupe commentedSo now anon you clear to giving us 1.1 release. And can you also open bug report for drupal core?
Comment #5
caschbre CreditAttribution: caschbre commentedI'm not necessarily sure I'd mark this as won't fix. If the auto-complete doesn't allow for slashes due to a bug or by design, the linkit module won't allow for external links. I would think linkit needs to alter the design to allow for external links or remove the ability.
Comment #6
anonActually I agree with caschbre.
I was thinking, what if a simple JS script could remove the connection to the core autocomplete if a slash is given?
Found this in misc/drupal.js
Comment #7
anonARGH! Its seems impossible to use the detach functions.
So I tryed to make a fucntion that would recognize slashes in the input value and when a slash was found, it would disable the autocomplete function and so on, But that was also very hard to make good.
My next approach is to create a checkbox, that will toggle autocomplete on and off.
What do you think about this? (See patch)
Comment #8
anonComment #9
vitok-dupe CreditAttribution: vitok-dupe commentedanon: "What do you think about this?"
Waste of time, it's drupal core bug!
Comment #10
anon@vitok: Yes it is, but what you suggest? That external linkin should give big error msg?
Comment #11
caschbre CreditAttribution: caschbre commentedI installed the patch and when the checkbox is ticked, I don't get the error.
From a usability perspective it still leaves a high probability that the user is going to start typing w/o selecting the checkbox. Even when I was testing and 'knew' I was supposed to test it, I just started typing and got the error.
Unfortunately I don't know javascript well enough to offer technical suggestions on how to capture the user entering the slash (/). And I'm not sure you could design it (UI wise) to really work around it because the user could still enter the slash at any time.
If the issue is at the core auto-complete level, then maybe we leave this issue open and reduce it to normal and link to a core issue?
Comment #12
vitok-dupe CreditAttribution: vitok-dupe commentedYou can fix this only with patch for drupal core, other ways it's just a waste of time! You write the fix for now, giving people new release, but that happens then drupal core bug will be fixed? You will need to remove your fix and making new release?
Core Taxonomy autocomplete with slash typing giving error.
Core User autocomplete with slash typing giving error.
Core any way autocomplete with slash giving error.
Why you take "Linkit autocomplete slash error" problem personally to yourself, and thinking that it's very bad for Linkit? It's bad for drupal at all!
Comment #13
anonOk, We really need a new Linkit release, so Im gonna go with you and vitok.
I will make a section at the project page with "Know problems".
Comment #14
caschbre CreditAttribution: caschbre commentedHere is the issue for core.
#995512: Autocomplete doesn't work with slashes
Comment #15
caschbre CreditAttribution: caschbre commentedSince we have to wait for core D7 to fix the bug, the linkit module has a few options...
1) No Ext Link Checkbox
Problem with this route is users will probably get frustrated with having to use two different wyiswyg buttons... one for internal and one for external.
2) Ext Link Checkbox
This is a workaround and the checkbox could be removed after core is fixed. But there isn't a need to push that out right away. It could wait until another update comes along.
In either case the known issue should be noted. Are there any other options?
Comment #16
anonI think your right. Lets wait and see what happening with he core issue.
I made a realse now, 7.x-1.1 is out.
Also added a "Know problems" section at the project page.
Comment #17
betamos CreditAttribution: betamos commentedPlease change back to active once d7-1.1 is out.
Comment #18
caschbre CreditAttribution: caschbre commentedI realize this can't be "fixed" until core is fixed... but was anything put in place to notify the user of the issue in the linkit popup, checkbox, etc.? I know we tossed out a few ideas to help deter users from entering the slashes.
The reason I ask is I'm testing the 7-dev version and forgot about the issue until it happened to me again. I noticed there wasn't anything in the D7 version to deter / notify me of the issue.
Comment #19
anonNo we didnt do anything, as like you said, we have to wait for the core fix first.
Comment #20
geek-merlinsub
Comment #21
caschbre CreditAttribution: caschbre commentedThe core issue I previously linked to was closed as a duplicate of #93854: Allow autocompletion requests to include slashes which appears to be a very very old issue. ugh.
Comment #22
swentel CreditAttribution: swentel commentedHere's a patch for linkit that works with the patch mentioned in #21. If this is committed in core, that patch alone won't be enough to fix it. So you need the core patch and this patch for the ajax error to go away.
Comment #23
anon@swentel, Thanks for the patch.
Me and betamos are currently working on a new major version of Linkit (7.x-2.x) and we have some different approch in that version on how we will handle the autocomplete.
Betamos has build a new autocomplete handler so we hope that this issue is going to solve itself with the next major Linkit version.
Comment #24
swentel CreditAttribution: swentel commented@anon Even than, you'll need the load arguments in the menu normally. Less work to maintain also :) (but that's your choice of course)
Comment #25
betamos CreditAttribution: betamos commentedI can confirm that slashes is working in the 7.x-2.x branch. Since we use urlencode and a get-parameter, it works fine. However, it's good that you addressed this issue again @swentel, because I rembered that I have not tested it without clean URL:s. I wrote a todo for it now.
Comment #26
anonWhen the core issue is solved, this will not be a problem for linkit.
Also, the 7.x-2.x version of Linkit handle this in a different way.
Comment #27
yseki CreditAttribution: yseki commentedOpen misc\autocomplete.js
go to line 293
change
url: db.uri + '/' + encodeURIComponent(searchString),
to
url: db.uri + '/' + encodeURIComponent(searchString.toString().replace('/', '')),
Comment #28
nymo CreditAttribution: nymo commented#27 worked, core be patched with this fix?
Comment #29
danielb CreditAttribution: danielb commentedThere is an alternate solution in a Drupal core issue queue
#93854: Allow autocompletion requests to include slashes
Comment #30
anonYes, this is exacly the issue.
Tho, in 7.x.-2.x this is solved in another way, see the Linkit project page for more info.