When I try to turn this on, I get the following:
Warning: Invalid argument supplied for foreach() in /home/martin/public_html/sites/www.hyperlogos.org/modules/linktocontent/plugins/linktonode/extensions/linktonode_category.inc on line 87
Warning: Cannot modify header information - headers already sent by (output started at /home/martin/public_html/sites/www.hyperlogos.org/modules/linktocontent/plugins/linktonode/extensions/linktonode_category.inc:87) in /home/martin/public_html/includes/common.inc on line 266
It does appear to have turned on, and I can now check the boxes and save. This happens reliably; if I turn it off, that works fine, but when I turn it on, it throws this error and doesn't load anything else. I have to manually reload the page, at which point I can see that the settings have been saved.
I've now been waiting for about five minutes for the plugin to build the list of linkable documents, and it hasn't made any visible progress.
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | functions.js_2.txt | 7.95 KB | stborchert |
| #29 | New Picture (4).jpg | 14.6 KB | ssteinem |
| #27 | insert.png | 7.44 KB | stborchert |
| #21 | functions.js_1.txt | 9.64 KB | stborchert |
| #18 | functions.js_0.txt | 10.14 KB | stborchert |
Comments
Comment #1
stborchertHi.
Sorry, but I can't reproduce this error. :-{
I have created tow screenshots of the settings page ([1] & [2]).
If I understand you right, you can't enable the category extension without this error and don't see the page in second image? Hmm.
Please try to use the current version in cvs (linktonode_category.inc v1.5). I've changed it a little (checking whether the form value is an array).
[1] default enabled
[2] category enabled
Comment #2
hyperlogos commentedHi, I just installed the CVS version and am having the same symptoms precisely.
Comment #3
stborchertDo you used the whole package (linktocontent_cvs.tar.gz) or only replaced linktonode_category.inc?
I've changed only the category-extension so you should now see a different error message (if there is one).
In line 87 the values of the checkboxes are read. At first save the array does not exists and
$values[...]isn't an array so this error occurs.But now I changed the call a little, so please try again with current versoin of linktonode_category.inc (v 1.5 2006/08/24 18:26:44).
Comment #4
hyperlogos commentedOkay, I no longer get the error. It still searches forever, though, or at least a hell of a lot longer than I'm willing to wait, which was something like half an hour. Sorry, I hadn't replaced the file properly. I have just upgraded the whole thing to cvs to see if that makes any difference. I clicked the button at 9:45 AM PST... Now it's 10:00 AM with no apparent progress... Now it's 10:36 AM, and I'm closing that tab and giving up on it.
Comment #5
stborchertThe search should be finished within seconds. Any JavaScript errors?
Comment #6
ssteinem commentedAt my installation I have the same problem with a never ending search. The "invalid argument" error could be fixed with the newest version, thanks.
The search ever ends undependent of the extension setting (default or category). Any help is appreciated.
Comment #7
stborchertCould you please give some more information:
- are there any javascript errors?
- which drupal version do you use?
- are the modules located in /modules?
- ...
Comment #8
ssteinem commentedSorry - here the details:
Drupal version 4.7.3, modules are at /sites/default/modules/...,
the java console shows lots of "unknown properties ... filter, declaration ignored" and the following exception:
Fehler: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http:///cgi-bin/drupal1/sites/default/modules/img_assist/img_assist_textarea.js :: insertToEditor :: line 88" data: no]
Comment #9
ssteinem commenteduppps - forget the javascript errors in the last posting, that was for another module: here the correct error message in the java console:
error: document.getElementById(obj) has no properties
Quelldatei: http://www.kirchestettlen.ch/cgi-bin/drupal1/sites/default/modules/tinym...
Zeile: 230
Comment #10
stborchertOk, thanks.
On your last but one posting I thought "ugh? What's this? That could not be caused by my module." :-)
It seems, the XMLHttpRequest does not return "ok" (status 200). Does your browser support ajax (and/or XMLHttpRequests)?
If you change line 230 of functions.js from
document.getElementById( obj ).innerHTML = "loadData error:\n" + req.statusText;to
alert(req.statusText);which message do you get?
PS: if you prefer talking in german please contact me (I'm from germany, so this should be no problem ;-) )
Comment #11
ssteinem commenteda popup returns: not found
PS: I hope that the URL in the error message gave me away, not my english...it's fine here in english
Comment #12
stborchert;-) The url gave the hint.
Ah, that sounds good. Err, I mean now I know the problem. Have a look at line 176:
var url = tinyMCE.baseURL.substring( 0, tinyMCE.baseURL.indexOf( 'modules/' ) );I expected the modules at "drupal_inst/modules" but your (and certainly many others, too) are at "sites/default/modules".
So the request is misleadingly sent to "http://your_site/sites/default/ltc/linktonode/" instead of "http://your_site/ltc/linktonode/".
Perhaps you could try the following code until i submit a patch:
Comment #13
ssteinem commentedThanks for the code. In the meantime I moved the module... with the same result. Adding the patch code does not change anything, either.
Fehler: document.getElementById(obj) has no properties
Quelldatei: http://myhomepage/cgi-bin/drupal1/modules/tinymce/tinymce/jscripts/tiny_...
Zeile: 235
The code around 176 looks like this (so 235 is the original line 230)
// error correction of: var url = tinyMCE.baseURL.substring( 0, tinyMCE.baseURL.indexOf( 'modules/' ) );
var url = tinyMCE.baseURL.substring( 0, tinyMCE.baseURL.indexOf( 'modules/' ) );
if (url.indexOf('sites/') > -1) {
url = url.substring(0, url.indexOf('sites/'));
}
url = url + 'ltc/linktonode';
// end of correction
// native XMLHttpRequest object
if (window.XMLHttpRequest)
Comment #14
stborchertIt's weird.
I will build a debug version so you can follow each step the plugin does.
Comment #15
stborchertBy the way: which result do you get on calling http://myhomepage/cgi-bin/drupal1/ltc/linktonode?
Something like this?
(Its a check, whether linktocontent.module returns correct results to the tinymce-plugin.)
Comment #16
ssteinem commentedI cannot activate "clean URL" on my homepage (ISP restriction). Using ?q=... I get the following response:
{ "category": [ { "vid": "9", "tid": "9", "title": "Checklist" }, { "vid": "7", "tid": "7", "title": "Forums" }, { "vid": "6", "tid": "6", "title": "Image Galleries" }, { "vid": "4", "tid": "4", "title": "Teilnehmerkreis" }, { "vid": "5", "tid": "5", "title": "Themenkreis" }, { "vid": "3", "tid": "3", "title": "Veranstaltungstyp" } ], "node": { } }
Comment #17
stborchertThis looks good and shows linktocontent.module is working as expected.
So we have to focus on the tinymce plugin (linktocontent) and escpecially functions.js.
Comment #18
stborchertWell, same procedure as on this bug:
The attached file displays several alerts on opening the plugin window. They should be like the following:
If its all ok a drop down is inserted in the plugin window which contains your top level categories (vocabularies).
If not: please write down which alert aren't shown.
Comment #19
ssteinem commentedOK - "loadCategories called"
OK - "tinyMCE.baseURL: http://.../modules/tinymce/tinymce/jscripts/tiny_mce
requestURL: http://.../ltc/linktocontent"
OK - "XMLHttpRequest: [Object XMLHttpRequest]"
OK - "send request: http://.../ltc/linktocontent/"
OK - "request state: 1"
OK - "request state: 1" <== twice
OK - "request state: 2"
OK - "request state: 3"
OK - "request state: 4"
404 - "not found"
Comment #20
ssteinem commentedupps ... didn't like the "less than" sign. Here all the lines:
OK - "loadCategories called"
OK - "tinyMCE.baseURL: http://.../modules/tinymce/tinymce/jscripts/tiny_mce
requestURL: http://.../ltc/linktocontent"
OK - "XMLHttpRequest: [Object XMLHttpRequest]"
OK - "send request: http://.../ltc/linktocontent/"
OK - "request state: 1"
OK - "request state: 1" ! twice !
OK - "request state: 2"
OK - "request state: 3"
OK - "request state: 4"
404 - "not found"
Comment #21
stborchertIts ok (status 1 means it is loading).
Request is completed but returns "not found"!?
Ahh, think I got it! In #16 you said
. But the request calls ".../ltc/linktonode", not ".../?q=ltc/linktonode"
Please try the attached file (there should be only an alert in case of an error).
Comment #22
ssteinem commentedThere is one message: send request: /cgi-bin/drupal1/?=ltc/linktonode/
I believe the q is missing after ?
Otherwise the search now stops and displays... no documents
Comment #23
stborchertArgh, you're right.
With or without "q"?
We're one the way to get it :-)
Comment #24
ssteinem commentedWith my limited php knowledge I inserted to "q". Now I get the nodes as expected.
But so far no link is inserted in the text if I say "insert".
Comment #25
stborchertWell, we are close to the solution.
What message do you get if you modify functions.js like this (around line 32)
Comment #26
ssteinem commentedComment #27
stborchertArgh, really annoying, isn't it!?
Please try (lines 38ff.)
.
It should look like the attached screenshot.
Comment #28
stborchertUps, tinyMCEPopup should look like this:
tinyMCEPopup.execCommand("mceInsertContent", false, '<a href="' + nid + '">' + insertText + '</a>');Comment #29
ssteinem commentedWell, attached the popup. I believe that a few lines got dropped:
I inserted these lines.
Now, inserting without selecting text works in both IE and Firefox. Inserting a link when text is selected causes firefox to insert the link without the ?q=node/.... IE changes the appearence of the text but no link is inserted.
Comment #30
stborchertGrml, near to solution but not yet completed...
What happens if you try the attached version?
I've removed half of the "insertAction" method and reduced it to nearly
Hopefully it sometimes will work better with jQuery.
Comment #31
ssteinem commentedThat looks much better (after inserting the ?q= in the URL string again). It now works for both IE and Firebox, inserting and modifying text.
But, no, I won't shut up just yet:
1. There is a maximum of 3 articles shown, even if there would be more than three. Can this easily be changed?
2. Can there be more text then just the title (something like a date would help if there is more than one entry with the same title)?
Thanks, anyway.
Comment #32
stborchertArgh. Never change an old version. Grml, it's not good to have multiple versions and don't know which is the current one :-{
You haven't to. I'm happy that someone can use it and give hints and suggestions to me.
I do not exactly know what you are meaning. Do you mean the node list in the popup only shows 3 items?
If so could you please create a new bug report (because I would mark this one as closed then).
I created a feature request and will see what I can do for you.
Comment #33
stborchert