Criteria / Stacked Attributes Incorrect Record Selection

Discuss, research, share, find, and solve bugs

Criteria / Stacked Attributes Incorrect Record Selection

Postby spiro » 8:22pm, Wed 08 Dec, 2010

Hi all,

Having spent some time testing stacked attribute criteria selection quite extensively on a fresh install v2.10.12 with very few mods I've found the following issues.

I have only made minimal mods that I can see relate to this area, namely, a fix to cleanCommaList in admin/connector.php to comment out the first line in the current version of this function (i.e. to remove the "if" statement line). I also looked at the mantis issue relating to missing parentheses in send_core.php (http://mantis.phplist.com/view.php?id=9983) and tested prior to adding these as well as with them in place, with them being added making some improvement.

DB stored values...

stackedattributetesting.JPG
Test User's DB Values
stackedattributetesting.JPG (21.47 KiB) Viewed 6002 times


Both users belong to the same active list and this is the list that was selected each time a test message was sent. Only a single criterion was tested on each test message.

Am just going to list the items I think are not working correctly...

radio & select type fields

operator = is not
Whilst this matches records with values other than the one you enter in this scenario, it doesn't find records where the user has never chosen a value for this field. If the user has chosen "-- no value" and saved this, then this is stored as '0' (zero) in the DB (which is ok), otherwise if no selection has been saved then the DB field default is 'NULL'. Therefore when making a criteria selection, i.e.radio2 or select2 is not 1, it does not find records where the value is NULL.


checkbox

operator = is unchecked
Prior to the parentheses mod in send_core.php as per mantis, checkbox1 & 2 both fail due to both records (users) being selected. After making the mod, checkbox2 still fails as it should have selected User A, but instead failed to select anyone.

operator = is not unchecked
Prior to the parentheses mod in send_core.php as per mantis, checkbox1 & 2 both fail due to both records (users) being selected. After making the mod, checkbox1 still fails, but now selects the wrong user and checkbox2 fails to select anyone.

operator = is not checked
Same failure occurs either pre or post parentheses mod in send_core.php. The user record that is checked is the one that is chosen, i.e. with checkbox1, User A is selected, and with checkbox2, User B is selected.


checkbox group

operator = is
Two values checked in criteria selection to match a single user:

Prior to the parentheses mod in send_core.php, checkboxgroup1 fails due to both users being selected when selecting values 2 & 3 to both be checked. checkboxgroup2 does pass this test in this scenario but I think that could be because User A has a NULL value. I should really of had a third user with some sort of value in this field to test this further. However, post parentheses mod does result in the correct user being selected when retesting checkboxgroup1 with values 2 & 3 both checked again.

Single value checked in criteria selection to match one of the values in a users pair of values:

When a single value chosen in criteria selection for checkboxgroup1 i.e. value 2, this resulted in User A being selected even though it was only a partial match for this user who has values '2, 3' stored in this field. The same occurs when trying this with checkboxgroup2 when value 3 was checked in criteria selection, resulting in User B being selected. This occurs the same either pre or post parentheses mod.

operator = is not
Single value checked in criteria selection to not match any value that a user has stored:

When a single value was entered for checkboxgroup1 and later checkboxgroup2, i.e. value 1 was checked in criteria selection, this should have matched both users (due to 'is not') but instead did not match any. This occurs the same either pre or post parentheses mod.

Single value checked in criteria selection to match one of the values in a users pair of values:

When a single value was chosen in criteria selection for checkboxgroup1 i.e. value 2, and later checkboxgroup2, i.e. value 3, this should have matched both users but instead did not match any. This occurs the same either pre or post parentheses mod.


date

When adding a date criterion entry I notice the value entered, that shows up in the values column of the existing criteria table has a comma appended after the date value. Am not sure if this only relates to the value being reported to the screen.

operator = is not
Doesn't send to those users that have a blank or NULL date value.

operator = is before
The date entered is also included in the search results whereas I think it should take 1 day off the date entered in the criteria to test the data against. i.e. date2 criteria is before 25/12/2010 currently results in User B being selected.

operator = is after
The reverse of "is before" above, i.e. date2 criteria is after 25/12/2010 currently results in User B being selected.


In the above limited examples of two users whenever no records were selected if you progressed to sending the message and manually processing the send queue this resulted in a 1064 DB error. Obviously in this scenario of processing a message send manually you would know it wasn't worth progressing if you calculated the number of records found on the criteria page but I don't know what would happen if you were using the auto process queue or a Cron job?

Database error 1064 while doing query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1


Regards
Spiro
As of July 2011
using the following on a shared Linux host:


PHPList: v2.10.14,FCKeditor: 2.6.3 (as distributed with phpList),PHP: 5.2.14,PHPMailer: ??,Apache: 2.2.11with OpenSSL enabled.
spiro
PL Geek
 
Posts: 50
Joined: 7:37pm, Thu 29 Jan, 2009

Re: Criteria / Stacked Attributes Incorrect Record Selection

Postby boombari » 10:29am, Fri 27 Apr, 2012

Hi,

did u have solved ?
boombari
phpList newbie
 
Posts: 2
Joined: 6:11pm, Mon 20 Feb, 2012


Return to Bug Discussion

Who is online

Users browsing this forum: No registered users and 2 guests