Closed (fixed)
Project:
Closed Question
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Mar 2011 at 17:19 UTC
Updated:
30 Mar 2011 at 13:08 UTC
Jump to comment: Most recent file
Comments
Comment #1
jvdkolk commentedHow to reproduce this error:
1) Create a new question
2) Leave the XML blank
3) Save the question
You will get a PHP warning
warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in /drupal/sites/all/modules/closedquestion/question/FactoryQuestion.inc.php on line 85.
Problem loading question in node 1709
Comment #2
HylkeVDS commentedKarinaj, did you get any other errors?
I would expect an error from the XML parser, similar to what rekcor mentioned. If your installation has error reporting turned off you might have to look in the log files of your http server.
Comment #3
Karinaj commentedHi,
I find 3 warnings in a log:
Notice: Undefined variable: question - cq_question_from_xml() (eilutė 96 iš /home/svedukal/public_html/sites/all/modules/closedquestion/question/FactoryQuestion.inc.php).
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input - cq_question_from_xml() (eilutė 85 iš /home/svedukal/public_html/sites/all/modules/closedquestion/question/FactoryQuestion.inc.php).
Notice: Undefined index: und - closedquestion_load() (eilutė 307 iš /home/svedukal/public_html/sites/all/modules/closedquestion/closedquestion.module).
I don't know why it says "Empty string supplied as input" - it's not empty at all.
Comment #4
HylkeVDS commentedAh, I just realised you're using a non-english translation of Drupal. In D7 the handling of translations changed, the port of ClosedQuestion doesn't deal with that yet, so apparently it's looking in the location of the English version.
Comment #5
Karinaj commentedI have a test site, that is only in English, but it's the same.
Comment #6
HylkeVDS commentedThe message "Notice: Undefined index: und" means the language is not set to the default ("und" means "undefined" I just found out)
I've updated the 7.x dev release that should fix it. Can you try that, once the build scripts have re-build it?
It also shows the language code the node uses, what does it list for you?
Comment #7
Karinaj commentedHmm, the date at the 7.x dev release is still March 28, others are March 29 :)
Language code is English (in general I have three available languages - English, Swedish and Lithuanian), and, as I said, I have another site, for testing, developing, so that other site has only English language. I have installed Closed Question on my test site, but I get the same error messages, so probably it's something else, not the language issue?
Comment #8
HylkeVDS commentedThe build scripts on development builds run only every so often. You could try to apply the patch manually:
http://drupalcode.org/project/closedquestion.git/commitdiff/c5d6478?hp=3...
Just adding the following to the function closedquestion_load should give us enough information to see if it really is the problem:
Explicitly setting it to English is different than leaving it undefined.
Comment #9
Karinaj commentedHi,
now it's better, but not completely. I attached an image of what happens. I didn't create my own question, just copy-pasted a single-choice example from your examples.
Comment #10
Karinaj commentedwarnings:
Notice: Undefined index: und in CqQuestionAbstract->initialise() (line 200 of /home/svedukal/public_html/sites/all/modules/closedquestion/question/CqQuestionAbstract.class.php).
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input in CqQuestionAbstract->initialise() (line 205 of /home/svedukal/public_html/sites/all/modules/closedquestion/question/CqQuestionAbstract.class.php).
Comment #11
HylkeVDS commentedAh, yes, another one.
In a few moments 7.x-2.0-beta2 should be on-line. Can you try that one?
It's an updated version with all the improvements of the 6.x-2.x branch. It does have one additional dependency, on the libraries module. http://drupal.org/project/libraries
It also needs some extra javascript libraries, but it also works if you don't install those on your own server. In that case it will use versions of a remote server.
Comment #12
HylkeVDS commentedI found one last reference to 'und', it's in lib/XmlLib.inc.php
Change line 108 from:
to:
Comment #13
Karinaj commentedIt works, it works!
I installed the new version, and it finally works. Thanks a lot!
I can see that it has an interface for editing now. It's really very usefull. I like this module.
Comment #14
HylkeVDS commentedYou're welcome :)