Numbers in a range
Permalink Browser Info Environment
I previously had version 5.6.0.0.0.5.5 installed which included the "is more than or equal to search value" within the Filter settings. Although this works generally using a range from 2-9, but when adding numbers for 10, 11 & 12, it doesn't work. I think it registers the numbers as a normal text string and then puts 10, 11 & 12 before 2. Is there any way in incorporating a number select attribute. This would sort this issue.
Also I have now upgraded to version 5.6.0.0.0.5.6.1 and some of the Filter settings have disappeared including those mentioned above ie. "is more than or equal to search value".
Please help.
Also I have now upgraded to version 5.6.0.0.0.5.6.1 and some of the Filter settings have disappeared including those mentioned above ie. "is more than or equal to search value".
Please help.
Type: | Discussion |
---|---|
Status: | In Progress |
Hi,
Is there any progress with this addition to the block. We are close to going LIVE with a site that uses this extensively and ideally want this functionality when we do go LIVE.
Thanks
Is there any progress with this addition to the block. We are close to going LIVE with a site that uses this extensively and ideally want this functionality when we do go LIVE.
Thanks
The latest version, 5.6.0.0.0.5.7 should resolve the issue you are having. The only caveat is the way that the core Select Attribute Type controller works. You will need to update it to bypass the addition of newlines in the search attribute table.
This is the code I developed to do that. It is a direct overwrite; you may want to to do something else. Update the getSearchIndexValue() method in {root}/concrete/core/models/attribute/types/select.php file around line 342:
I hope this helps.
This is the code I developed to do that. It is a direct overwrite; you may want to to do something else. Update the getSearchIndexValue() method in {root}/concrete/core/models/attribute/types/select.php file around line 342:
public function getSearchIndexValue() { if (!in_array($this->getAttributeKey()->getAttributeKeyHandle(), array('my_attribute_to_ignore'))) { $str = "\n"; } $list = $this->getSelectedOptions(); foreach($list as $l) { $l = (is_object($l) && method_exists($l,'__toString')) ? $l->__toString() : $l; $str .= $l; if (!in_array($this->getAttributeKey()->getAttributeKeyHandle(), array('my_attribute_to_ignore'))) { $str .= "\n"; } } // remove line break for empty list if ($str == "\n") { return '';
Viewing 15 lines of 18 lines. View entire code block.
I hope this helps.
The next version should fix your issues.