Opened 10 years ago

Closed 7 years ago

#8631 closed defect (duplicate)

dojo.query does not like the = character

Reported by: Matthias Sch. Owned by: dylan
Priority: low Milestone: future
Component: Query Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

i'm using zend framework and converted my existing dropdown-box to a filteringselect-dijit. i know that this is not the zf issue tracker, but it looks like a dojo-gug:

my form control: $start_newsfeed = $this->createElement('FilteringSelect?', 'start_newsfeed'); $start_newsfeed->setLabel('Startseite: Newsfeed') ->addMultiOption(, '(Standard)'); foreach (App_Core::getInstance()>getConfig('feeds')>feed->news->toArray() as $item) $start_newsfeed->addMultiOption($itemlink?, $itemname?);

this creates a list: <option value="http://www.diebauzeitung.at/extend/rss.php?id=47018&z=20" label="diebauzeitung.at" selected="selected">diebauzeitung.at</option> <option value="http://www.wirtschaftsblatt.at/rss/heute" label="WirtschaftsBlatt? Heute">WirtschaftsBlatt? Heute</option>

when i populate the field with the settings read from the db, there are 2 different results: if the value is "http://www.diebauzeitung.at/extend/rss.php?id=47018&z=20" then there is nothing selected... if the value is "http://www.wirtschaftsblatt.at/rss/heute" then the correct entry "WirtschaftsBlatt? Heute" is selected...

maybe it does not correctly handle the special chars (? & ; =) in the value?

Change History (10)

comment:1 Changed 10 years ago by bill

Maybe. It's hard to tell without a test case (and I need a test case against plain dojo, not using zend). Can you attach a test case? You should be able to see what zend is generating (and sending to your browser) just by doing a view source.

comment:2 Changed 10 years ago by Matthias Sch.

var zendDijits = [{"id":"start_newsfeed","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_google","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_weather","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"save","params":{"label":"Speichern","dojoType":"dijit.form.Button"}},{"id":null,"params":{"dojoType":"dijit.form.Form"}}];

<select name="start_newsfeed" id="start_newsfeed">

<option value="http://www.diebauzeitung.at/extend/rss.php?id=47018&amp;z=20" label="diebauzeitung.at" selected="selected">diebauzeitung.at</option> <option value="http://www.wirtschaftsblatt.at/rss/heute" label="WirtschaftsBlatt? Heute">WirtschaftsBlatt? Heute</option>

</select>

---

var zendDijits = [{"id":"start_newsfeed","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_google","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"start_weather","params":{"dojoType":"dijit.form.FilteringSelect?"}},{"id":"save","params":{"label":"Speichern","dojoType":"dijit.form.Button"}},{"id":null,"params":{"dojoType":"dijit.form.Form"}}];

<select name="start_newsfeed" id="start_newsfeed">

<option value="http://www.diebauzeitung.at/extend/rss.php?id=47018&amp;z=20" label="diebauzeitung.at">diebauzeitung.at</option> <option value="http://www.wirtschaftsblatt.at/rss/heute" label="WirtschaftsBlatt? Heute" selected="selected">WirtschaftsBlatt? Heute</option>

</select>

comment:3 Changed 10 years ago by bill

Oh I see , I didn't realize you were talking about the value attribute of the option tag. Yeah, I assume like you said that it's choking on the special characters.

I assume the zendDijits parameter above is unneeded.

comment:4 Changed 10 years ago by bill

Milestone: tbd1.4

comment:5 Changed 10 years ago by Douglas Hays

Component: DijitCore
Owner: set to alex
Summary: filteringselect/combobox: value not set correctly (special chars?)dojo.query does not like the = character

This appears to be a dojo.query bug. Consider the following snipit:

<select>
<option value="=">=</option>
<option value="=4">=4</option>
<option value="4=">4=</option>
<option value="4=4">4=4</option>
</select>
<input type=button onclick=alert(dojo.query("option[value='=']")[0]) value="query option with =">
<input type=button onclick=alert(dojo.query("option[value='=4']")[0]) value="query option with =4">
<input type=button onclick=alert(dojo.query("option[value='4=']")[0]) value="query option with 4=">
<input type=button onclick=alert(dojo.query("option[value='4=4']")[0]) value="query option with 4=4">

dojo.query with = and 4= correctly return option nodes, but =4 and 4=4 incorrectly returns nothing on FF2, FF3, IE6, IE7, and Safari 3.
On Safari 4, all 4 tests correctly return an option element. I'm testing on the latest trunk = [17488].

comment:6 Changed 10 years ago by bill

Component: CoreQuery

comment:7 Changed 10 years ago by James Burke

With latest trunk code and FF 3.5, the tests doughays now pass. IE8 also works, but IE7 is still broken.

comment:8 Changed 9 years ago by James Burke

Milestone: 1.4future

comment:9 Changed 8 years ago by Chris Mitchell

Owner: changed from alex to dylan

please review/triage

comment:10 Changed 7 years ago by ben hockey

Priority: highlow
Resolution: duplicate
Status: newclosed

Duplicate of #7479.

Note: See TracTickets for help on using tickets.