Notice

This old forum is now only available for consultation/read. User accounts on this old website are blocked.
Please create a new account on seblod.com and use the new forum http://www.seblod.com/community/forums.
Apologies for this perturbation and thank you for your understanding!
Welcome, Guest
Username Password: Remember me

[Patch 20120824] Multiple fields d'ont work properly (Now AND, OR, NOT, EMPTY, ALL in searchform possible)
(1 viewing) (1) Guest

TOPIC: [Patch 20120824] Multiple fields d'ont work properly (Now AND, OR, NOT, EMPTY, ALL in searchform possible)

[Patch 20120824] Multiple fields d'ont work properly (Now AND, OR, NOT, EMPTY, ALL in searchform possible) 2 years, 8 months ago #1

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Important Notice - Generally all data remains fully compatible even after removal of the patch.
Only for version >= 2.3.6

Compatibility: 2.3.6, 2.3.7, 2.3.8, 2.3.9, 2.3.9.2

Seblod 2.0, 2.1, 2.2 (no longer supported)
Version >= 2.3.6 -> see post @12 Patch
and see post @25 Report

Hello!
The fields checkbox, Select - Multiple and Select - Dynamic d'ont work properly (search). I changed the source code.
Les champs checkbox, Select - Multiple and Select - Dynamic ne fonctionnent pas correctement (recherche).

Best regards
Castor
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 1 year, 7 months ago by Castor.
The following user(s) said Thank You: Kobalt

Re: Multiple fields d'ont work properly 2 years, 8 months ago #2

Hi Castor,

Thank you for your post and welcome to forum seblod

Before affirming that the fields do not work, can you give examples where they do not work? Can you also send screenshots?

Regards,
Mehdi.
If you use SEBLOD CCK, please post a rating and a review at the Joomla! Extensions Directory. Thanks to you.!!"

2012 J!OSCAR[/size] :: Vote for SEBLOD
The following user(s) said Thank You: jodafatass

Re: Multiple fields d'ont work properly 2 years, 8 months ago #3

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Hello,
I've added pdf-file.
Attachments:
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 8 months ago by Castor.

Re: Multiple fields d'ont work properly 2 years, 8 months ago #4

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Version >= 2.3.6 -> see post @12 Patch
and see post @25 Report
Hello,
I've added App Folder as zip-file. Just install app_cck_testapp with extensions-manger and modify Article (Admin Form and Content). After that edit articles and create one menu-item for searchform (Items suchen). Now you can test.
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 2 months ago by Castor.

Re: Multiple fields d'ont work properly 2 years, 8 months ago #5

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Bonne journée à tous.

J'ai fait des recherches supplémentaires:

A mon avis il y a aussi une erreur logique en posent la requête a la base de données. Pour cette raison, j'ai modifié les paramètres d'un article pour illustrer le problème.

Voir le fichier PDF ci-joint.
Attachments:
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 8 months ago by Castor.

Re: Multiple fields d'ont work properly 2 years, 8 months ago #6

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Version >= 2.3.6 -> see post @12 Patch
and see post @25 Report
Bonjour à nouveau

J'ai une solution pour le moment. Même un changement dans l'ordre de tri est possible sans avoir à changer la base de données comme c etait le cas avant.

Chercher:

yoursite/plugins/cck_storage/custom/custom.php (214)
$sql = $target.' REGEXP "'.$TA.'.*'.$value.'.*'.$TZ.'"';


yoursite/plugins/cck_storage/standard/standard.php (158)
$sql = $target.' LIKE "%'.$value.'%"';
et remplacer par:

$separator = ( $field->divider ) ? $field->divider : ' ';
$value_array = explode($separator, $value);
if (count($value_array) > 1) {
foreach ($value_array as $value_array_item) {
$testquery = str_replace('<skip>','',$testquery);
$testquery .= $target.' LIKE "%' . $value_array_item . '%" AND<skip> ';
}
} else {
$testquery = $target.' LIKE "%' . $value_array[0] . '%"';
}
$sql = str_replace('AND<skip> ','',$testquery);


Un fichier PDF et un fichier de patch (zip) est attaché.

Vous trouverez certainement une meilleure solution au problème! En tout cas, vous avez fait un excellent travail jusqu'ici!

Bravo!
Attachments:
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 2 months ago by Castor.

Re: Multiple fields d'ont work properly 2 years, 7 months ago #7

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Version >= 2.3.6 -> see post @12 Patch
and see post @25 Report
Rebonjour a tous,

La fonction clearForm du script java a aussi du être retravaillée

yoursite/libraries/cck/rendering/assets/js/rendering.js

Chercher:
else if(b=="select")this.value=""

remplacer par:

else if(b=="select"){for (i=0;i<this.options.length;i++){
this.options[i].selected=false;} this.value="";}

Un fichier de patch (zip) pour SEBLOD 2.1 est attaché relatif à tous les problèmes (vérifer sous joomla 1.7.3 et 2.5.0_Beta2).
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 2 months ago by Castor.

Re: Multiple fields d'ont work properly 2 years, 7 months ago #8

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Version >= 2.3.6 -> see post @12 Patch
and see post @25 Report
Un fichier de patch (zip) pour SEBLOD 2.0 est attaché relatif à tous les problèmes (vérifer sous joomla 1.7.3 et 2.5.0_Beta2.
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 2 months ago by Castor.

Re: Multiple fields d'ont work properly 2 years, 7 months ago #9

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Dois je faire part de ce probleme au bugtracker? - May I submit this issue to bugtracker?
Working on JOOMLA (latest) and SEBLOD (latest)

Re: Multiple fields d'ont work properly 2 years, 7 months ago #10

Bonjour Castor,

May I submit this issue to bugtracker?

Yes, please submit a report on the Tracker, and I'll reply there asap.

Thanks & Regards,
Saba.
...
Last Edit: 2 years, 7 months ago by SEBLOD - Saba.

Re: Multiple fields d'ont work properly 2 years, 7 months ago #11

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Version >= 2.3.6 -> see post @12 Patch
and see post @25 Report
In version SEBLOD 2.3.7 the same bug is present. I've added a patch SEBLOD 2.2.0
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 2 months ago by Castor.

Re: [Patch 20120824] Multiple fields d'ont work properly (Now AND, OR, NOT, EMPTY, ALL in searchform possible) 2 years, 6 months ago #12

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
Important Notice - Generally all data remains fully compatible even after removal of the patch.
Only for version >= 2.3.6

Attention! Make a backup from your database before using the patch!!!! - After using the patch you have to setup all your entries in joomla witch use multiple elements (Match: Permissive (Default) Storage: standard or custom)


Compatibility: 2.3.6, 2.3.7, 2.3.8, 2.3.9, 2.3.9.2

latest version:

2012 august 24 - (patch_seblod_2.3.9_20120824.zip)

File Attachment:

File Name: patch_seblod_2.3.9_20120824.zip
File Size: 21 KB


2012 august 24 - (patch_seblod_2.3.9_20120824.tar.gz)

File Attachment:

File Name: patch_seblod_2.3.9_20120824.tar.gz
File Size: 12 KB



Changelog:
:pinch: Warning: Spoiler!



old version:
2012 july 21 - (patch_seblod_2.3.9_20120721.zip)


restore version:
Version >= 2.3.6 (files_before_patch_seblod.zip

File Attachment:

File Name: files_before_patch_seblod.zip
File Size: 18 KB


Version >= 2.3.6 (files_before_patch_seblod.tar.gz)

File Attachment:

File Name: files_before_patch_seblod.tar.gz
File Size: 11 KB



Currently, a search within multiple elements with more than one selection returns any proper results. Affected are all multiple elements, such as selectboxes (select_dynamic) and checkboxes.

One possibility would be to set the items accordingly:
Position 3 in the construction sheet:

construction_sheet.jpg



Radio:
Exact

Checkbox:
Any Words = OR
Each word = AND

Select simple:
Exact

Select multiple: (select_dynamic)
Warning: implode() [function.implode]: Invalid arguments passed in ....\plugins\cck_field\select_dynamic\select_dynamic.php on line 219 -> Patch necessary

The risk when using the patch:

disadvantages:
  • this is a patch! The next update from SEBLOD will overwrite everything you have changed.
  • you have to setup all your entries in joomla witch use multiple elements, otherwise first and last entry in multiple elements can not be found


Attention!
  • once data for a multiple field exist - aviod to change the separator and the values of course
  • spaces can also be used as a separator if you use values for your entries. Default is comma


benefits:
  • with this patch, it is possible to use multiple elements in the searchform correctly.
  • javascript function clearForm works for all elements (multiple)
  • leading zeros in the values ​​of the entries are no longer necessary. (A=01 A=1 C=11 D=101 E=110)
  • you can change the sorting order of entries in your elements without changing the records in the database
  • save storage space in database
  • now you can use free and construction SQL Query (there are no problems with the values)
  • decide whether AND - OR - NOT - EMPTY or ALL to use in the search form for each multiple element like checkboxes select multiple (dynamic and/or static)
  • create complexe questions in searchforms directly
  • decide whether NOT - EMPTY or ALL to use in the search form for each element like radio or select simple
  • EMPTY or ALL is to test your database to see if data has been entered or not
  • positioning of the search form after the result is now possible
    :pinch: Warning: Spoiler!
  • all fields of the form are hidden by css (inline) -> all fields are still available in your list

for example:
fields.jpg


normal SQL construction: - You have to define Options Name and Options Value
sql_query_construction_1.jpg


and the same as SQL free: - You have to create an SQL-statement for example:
SELECT country_fr text, id value FROM #__cck_extra_country WHERE id > 0
text is keyword for Options Name
value is keyword for Options Value
sql_query_free_1.jpg


and now with the ability to use AND or OR in your query:
creation:
construction_pointer_and_or.jpg

and now with the ability to use AND or OR or NOT or EMPTY or ALL in your query:
creation:
construction_pointer_and_or_2.jpg


Positioning in the search form:
searchform_pointer_and_or.jpg

and then try - this will work
(AND and OR can also be initialized with a value - after that you have to set it as hidden in the search form - this also will work - this is only useful by searching with AND or OR or NOT)
pointer_and_or_2.jpg


difference of the data in the database:
old method (for example: A=001 C=011 D=101 E=110) => 001,011,101,110
after patch (for example: A=1 C=11 D=101 E=110) => ,1,11,101,110, (you can see leading and closing comma leading zeros in the values ​​of the entries are no longer necessary)

overwritten files are:

Part of the message is hidden for the guests. Please log in or register to see it.
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 1 year, 7 months ago by Castor.
The following user(s) said Thank You: SEBLOD - Bes, georgils, nithinp89, zaliyanna, Kobalt

Re: Multiple fields d'ont work properly 2 years, 6 months ago #13

  • zaliyanna
  • ( User )
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
Bravo @Castor merci de ta contribution, je vais tester ce patch car j'ai eu le même soucis.
j'ai une question :est il possible de spécifier un 'OU' au lieu d'un 'ET' dans le formulaire de recherche du multiselect et du checkbox
par ex lors d'une recherche:

options du multiselect/checkbox sont :

m1
m2
m3
m4

si l' option m1 sélectionnée lors de la recherche le résultat serait :

res1 ---m1,m2
res2 ---m2,m1
res3 ---m1

si les options m1 et m2 sont sélectionnées lors de la recherche le résultat serait :

res1 ---m1,m2
res2 ---m2,m1

mais si les options choisit sont m1 et m4
0 resultat actuellement

est il possible d'avoir les résultats

res1 ---m1,m2
res3 ---m1,
res2 ---m2,m1
res4 ---m4


en somme pouvoir changer la requête liée au multiselect /ou checkbox de 'ET' a 'OU'
Last Edit: 2 years, 6 months ago by zaliyanna.

Re: Multiple fields d'ont work properly 2 years, 6 months ago #14

  • zaliyanna
  • ( User )
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
ok je me répond,

c'est tout a fait possible de réaliser ce fonctionnement tout est prévu dans SEBLOD il suffit de mettre dans la correspondance avec "au moins un mot".

it works fine !

Re: Multiple fields d'ont work properly 2 years, 6 months ago #15

  • Castor
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 68
en somme pouvoir changer la requête lier au multiselect /ou checkbox de 'ET' a 'OU'

Salut,
J'ai changé le script légèrement. Maintenant, cela fonctionne bien dans les formulaires de recherche pour chaque élément (multiples) si l'on veut. Si la fonction n'est pas utilisée, alors ce n'a pas d'effets négatifs.
Bonne journée
Castor

version >= 2.3.6 -> see post @12 Patch
and see post @25 Report
Working on JOOMLA (latest) and SEBLOD (latest)
Last Edit: 2 years, 2 months ago by Castor.
The following user(s) said Thank You: SEBLOD - Bes
Time to create page: 0.56 seconds