bricoleurs / bricolage

Content management and publishing system
http://www.bricolagecms.org/
111 stars 51 forks source link

Fix for bug #280 -- searches using subelement_key_name parameter now only return current versions #38

Open bretdawson opened 12 years ago

bretdawson commented 12 years ago

Hi everybody,

This bug affects searches for stories and media using the subelement_key_name parameter.

At the moment, documents that contained a subelement in a previous version, but do not contain it in the current one, are returned incorrectly in a search.

This patch just adds a check to be sure the subelement records are active.

Thanks so much,

Bret

theory commented 12 years ago

Hrm. Those TRUEs shouldn't be in there; I don't believe they'll work on MySQL, will they? I think you can use '1'.

bretdawson commented 12 years ago

Double hm. There are existing TRUEs for the subelement_id parameter, so probably both subelement_key_name and subelement_id searches have been broken for MySQL for a while.

But! MySQL booleans seem a little better than they used to:

http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

I'll install MySQL and see how it copes in real life, but it looks promising.

gregheo commented 12 years ago

No test?!? :)

On 2011-11-11, at 5:23 PM, Bret Dawson reply@reply.github.com wrote:

You can merge this Pull Request by running:

git pull https://github.com/bretdawson/bricolage 280

Or you can view, comment on it, or merge it online at:

https://github.com/bricoleurs/bricolage/pull/38

bretdawson commented 12 years ago

OK, I've tried the whole thing with MySQL and the verdict is in: True and False work just fine, and so do TRUE and FALSE and true and false.

Greg, you are going to loooooove the test. One day.

theory commented 9 years ago

So, no need for this change, @bretdawson?