Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Bug list  »  Bug #169

Viewing Bug Advanced Details [ Jump to Bugnotes ] [ Bug History ] [ Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000169 core / field option feature N/A 2004-01-25 15:39 2006-09-01 17:24
 
Reporter hbernard View Status public  
Assigned To
Priority normal Resolution open Platform PC
Status feedback Duplicate ID OS (Server) Linux Mandrake 9.1
Projection none Version Builtin
ETA none Product Version
  Product Build
  Votes 1
 
Summary Making multiple select and 'values''table' working together
Description Currently, it is not possible to have multiple select values filled from an external table.

The only source for multiple select seems to be Values or Values2 array.
Steps To Reproduce Use ['values']['table'] with 'select' => 'M' together.

You ll have multiple select in Filter mode but not in A/C mode.
Additional Information / Solution Idea come from :
http://platon.sk/forum/projects/viewtopic.php?t=116

ugly patch is :
//<hbernard - Line 2650 - hack to make 'M'ultiple work with ['values']['table']
if ($this->fdd[$key]['select'] == 'M' && isset($this->fdd[$key]['values']['table'])) {
$this->connect(); //connection to mysql, required for set_values_from....
$this->fdd[$key]['values2'] = (array)$this->fdd[$key]['values2']
+ (array)$this->set_values_from_table($key);
unset($this->fdd[$key]['values']); //useless values
}
//>hbernard
 
System Description
Attached Files

Bug Notes
hbernard
2004-01-30 15:40

hack above is confirmed to be correct (but still ugly).
See : http://platon.sk/forum/projects/viewtopic.php?t=116
 
hbernard
2004-04-14 16:41

More rationnales about this :
- currently, multiple select is not possible when values come from an external table. (values-table has precedence to multiple select).
- But multiple select handle very well the storage of ID in the field, using values2.

Issue is : Why not fix PME in order to allow multiple select field to be filled with an external table.

Pros :
- this is an easy fix.
- this allow quick m:n bindings workaround for phpMyEdit.

Cons :
- The way the patch is made is a bit hacky : get values from table, append in values2, unset values
- this is not state_of_database_art

Nepto and others pme hackers, may I have your feedback on this.

edited on: 2004-04-14 22:40
 
nepto
2004-04-14 19:40

Well this is actually true? I thought that it is possible to fill in multiple select from external table. well if not, it is certainlly bug and should be fixed.

The patch is horrible, but I believe it may work.

There must be and cleaner way. I aggre that this is quite usable workaround for m:n bindings. People are not forced to use it, if they think "this is not state_of_database_art". ;-)
 
hbernard
2004-04-14 22:25

I just remember why I came to this horrible patch (Was 3 months ago, you know ;-) :

If you don't unset 'values', join will be performed and that's stupid because if field is multiple, this is not a true foreign key.

(This is a very sad but true side effect of an API which allow mixed arguments for mixed purpose, like 'values'.)

So I see two ways :
1- stick with the ugly-but-working patch

2-
+ remove the test on 'values''table' in has_multiple_select
+ don't make the join if has_multiple_select
+ remove some random test on 'values''table' floating around
+ i wonder what else

(2) is harder but cleaner, I will try this one if you agree

edited on: 2004-04-14 22:39

edited on: 2004-04-16 11:56
 
valedo
2006-09-01 17:24

hbernard thnx for this patch.
But nepto, please fix this bug NOT "horrible"!

:))
 

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy