this is in reference to http://californiabarexam.info

whenever I try to link to node, the browser window tells me that no documents are found. why is this?

Comments

bpedigo’s picture

StatusFileSize
new72.13 KB

I attached a screenshot of what's happening

stborchert’s picture

Assigned: Unassigned » stborchert

The category select-box isn't shown. Are there any javascript or php errors? Which drupal version do you use and are the modules located under /modules?
I need more information on your environment.

bpedigo’s picture

The category select-box isn't shown. Are there any javascript or php errors? Which drupal version do you use and are the modules located under /modules?
I need more information on your environment.

I see no jscript or php errors. I'm using the latest version of Drupal (4.7). All my modules are in the /modules directory. I am not sure what "category select" drop down you're talking about. When I go to administer->modules, I have enabled linktocontent.

stborchert’s picture

I am not sure what "category select" drop down you're talking about.

This one. If its not visible you can't browse through the taxonomy/category structure.

When I go to administer->modules, I have enabled linktocontent.

Sounds ok. Could please post the results of "http://your_path_to_drupal/ltc/linktonode".
There you should see something like this:

{ "category": [ { "vid": "62", "tid": "62", "title": "vocabulary #11" }, 
  { "vid": "83", "tid": "83", "title": "vocabulary #2" }, 
  { "vid": "51", "tid": "51", "title": "vocabulary #1" } ], 
 "node": {  } 
}
bpedigo’s picture

StatusFileSize
new83.33 KB

Thanks for trying to help me. I apologize for being such a n00b.

I can't seem to find the file/directory you're talking about. I will attach a screenshot of my directory structure as seen from gFTP.

(attached)

stborchert’s picture

Sorry, I did not clearly said what I meant: type the location in the addressbar of your browser.
If you have to call 'http://example.com/' to your drupal site, please enter 'http://example.com/ltc/linktonode'.
This is the address, the tiny-mce plugin calls in a XMLHTTPRequest (does your browser support this?) and I want to see, if the module works correct.

By the way: I wonder why the plugin window is such wide. It should be 400px wide and not resizable.

bpedigo’s picture

Oh, interesting. I never knew you could type a url location that doesn't literally exist.

Anyway, it worked! It returned:

{ "category": [ { "vid": "1", "tid": "1", "title": "Forums" } ], "node": { } }

I dunno why it is so wide either.

stborchert’s picture

Ok, looks good. The module works after all.
I will create a debug version of the tinymce-plugin (escpecially functions.js) which will generate alerts on errors so you can see whether the results are caught by the plugin.

stborchert’s picture

StatusFileSize
new10.14 KB

Well, let's go.
The attached file displays several alerts on opening the plugin window. They should be like the following:

- "loadCategories called"
- "tinyMCE.baseURL: http://.../modules/tinymce/tinymce/jscripts/tiny_mce
   requestURL: http://.../ltc/linktocontent"
- "XMLHttpRequest: [Object XMLHttpRequest]"
- "send request: http://.../ltc/linktocontent/"
- "request state: 1"
(- possibly "request state: 2" and "request state: 3")
- "request state: 4"
- "request status: 200" (guess, you'll not get this, but "not found")
- {"category": [{...}], "nodes": [{...}]}

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.

stborchert’s picture

Update
Please try the updated functions.js. The plugin doesn't take care of not set "clean urls".

stborchert’s picture

Update #2
change line 174 from
url = url + '?=ltc/linktonode';
to
url = url + '?q=ltc/linktonode';

The "q" was missing.

stborchert’s picture

Could you please try the newest version. The errors now should be fixed.

cooperaj’s picture

I'm getting this error.

Running 4.7.3 on winxp Apache 2 , mysql 5, php 5.

Not seeing the category dropdown though http://site.url/ltc/linktocontent does return the structured array.

Downloaded on the 4th Sep (so includes fix committed 3rd)

Thanks
Adam

cooperaj’s picture

I've narrowed it down to this call on line 164 of functions.js

results = parseJson(req.responseText);

it does not ever return, leaving 'loading...' till it times out and hence not ever showing the select box which isn't created till line 167.

Might be a PHP 5 issue. Not sure though. I remember there being PHP 5 issues with the parseJson function.

This is as far as I can go.

Thanks
Adam

stborchert’s picture

The newest version does not display the message "no documents found".
Do you see something like the attached screenschot (ignore the dropdown)? Or is the list a select with more than one items displayed (size="10")?

Any javascript-errors?

stborchert’s picture

StatusFileSize
new5.36 KB

The newest version does not display the message "no documents found".
Do you see something like the attached screenschot (ignore the dropdown)? Or is the list a select with more than one items displayed (size="10")?

Any javascript-errors?

stborchert’s picture

@#14
Ah, this could be a hint. I could not test it with PHP5, yet.
Thanks.

stborchert’s picture

Might be a PHP 5 issue. Not sure though. I remember there being PHP 5 issues with the parseJson function.
Hm, parseJson has nothing to do with php. Its pure JavaScript.

stborchert’s picture

results = parseJson(req.responseText);

Maybe drupal.js is not linked correct?

cooperaj’s picture

StatusFileSize
new7.76 KB

Yes everything seems to be linked to fine. It just occured that it may be a jQuery issue (am using jQuery) but it isn't since disabling it did nothing.

When opening the linktocontent box all I see is the screenshot.

Just for reference here is the Json array retrieved from the url.

{ "category": [ { "vid": "58", "tid": "58", "title": "Business Intelligence Content Classification" }, { "vid": "54", "tid": "54", "title": "Business Warehouse Content Classification" }, { "vid": "55", "tid": "55", "title": "Compliance Content Classification" }, { "vid": "52", "tid": "52", "title": "E-Systems Content Classification" }, { "vid": "74", "tid": "74", "title": "E-Systems KB Classification" }, { "vid": "65", "tid": "65", "title": "Europa House Content Classification" }, { "vid": "56", "tid": "56", "title": "Human Resources Content Classification" }, { "vid": "62", "tid": "62", "title": "Ilfracombe Content Classification" }, { "vid": "57", "tid": "57", "title": "Information Systems Content Classification" }, { "vid": "63", "tid": "63", "title": "Newquay Content Classification" }, { "vid": "59", "tid": "59", "title": "Operations Content Classification" }, { "vid": "60", "tid": "60", "title": "PC Support Content Classification" }, { "vid": "64", "tid": "64", "title": "Portsmouth Content Classification" }, { "vid": "61", "tid": "61", "title": "Programming Content Classification" }, { "vid": "67", "tid": "67", "title": "Redruth Content Classification" }, { "vid": "51", "tid": "51", "title": "Social Club Content Classification" }, { "vid": "68", "tid": "68", "title": "Stroud Content Classification" }, { "vid": "66", "tid": "66", "title": "Walton Road Content Classification" }, { "vid": "75", "tid": "75", "title": "Walton Road KB Classification" }, { "vid": "49", "tid": "49", "title": "Coach Company" }, { "vid": "70", "tid": "70", "title": "Committee Member" }, { "vid": "38", "tid": "38", "title": "Country" }, { "vid": "39", "tid": "39", "title": "Division" }, { "vid": "48", "tid": "48", "title": "Event Category" }, { "vid": "2", "tid": "2", "title": "Forums" }, { "vid": "71", "tid": "71", "title": "IS Area" }, { "vid": "69", "tid": "69", "title": "Job Type" }, { "vid": "24", "tid": "24", "title": "Location" }, { "vid": "41", "tid": "41", "title": "Meeting Type" }, { "vid": "53", "tid": "53", "title": "Menu Type" }, { "vid": "40", "tid": "40", "title": "Type" } ], "node": { } }

cooperaj’s picture

Oh, and an 'alert(req.responseText);' placed on line 163 shows a dialog with the above text in it, so it is definately a hang in parseJson().

Thanks
Adam

cooperaj’s picture

I've pulled apart parseJson and as a result done this:

//results = parseJson(req.responseText);
results = eval('(' + req.responseText + ');');

and low and behold it works! The question now begs, whats wrong with parseJson.

stborchert’s picture

Oh, and an 'alert(req.responseText);' placed on line 163 shows a dialog with the above text in it, so it is definately a hang in parseJson().

Hm, grml. I know, I'm annoying but do you really have the newest functions.js (v 1.6 2006/09/03 13:39:06)?

You have inserted your alert here:

      if (req.status == 200) {
        alert(req.responseText);
        results = parseJson(req.responseText);
        if (obj == null) {

What happens if you insert an alert after results = parseJson(req.responseText);?
I can't get the error and its making me mad :-\.
If its really parseJson() I don't why it sould be.
Too long text? I tested it with a result of more than hundred terms and it worked fine.
Special characters? I don't see any in your result and it worked for me with a lot of special chars.

...

stborchert’s picture

Re: #22
What the hell is going on there? ;-)
Ok, I'll check and test this tonight.

stborchert’s picture

Status: Active » Needs review

new version of functions.js

Does it work?

stborchert’s picture

Status: Needs review » Fixed

parseJson isn't used anymore

stborchert’s picture

Status: Fixed » Closed (fixed)