I guess I’ve found a bug with &tagData param and parseCustomPlaceholders function in ditto class.
Sample call
[[ditto? &startID=`0` &tagData=`name_tv1,name_tv2` ... ]]
returns an sql error
« Execution of a query to the database failed - Unknown column ’sc.name_tv1’ in ’field list’ »
I have investigated a bit and printed out $ditto->fieds
Array
(
[display] => Array
(
[db] => Array
(
[0 ] => id
[1] => tagsPhoto,typeRecette
[2] => published
[4] => pagetitle
)
[tv] => Array
(
[0 ] => thumbImg
[1] => typeRecette
[2] => tagsPhoto
)
)
[backend] => Array
(
[tv] => Array
(
)
[db] => Array
(
[0 ] => id
[1] => published
[2] => tagsPhoto,typeRecette
)
)
)
:-)
Quick and dirty fix
// ---------------------------------------------------
// Parse the required fields out of the custom placeholders
// ---------------------------------------------------
function parseCustomPlaceholders($placeholders) {
foreach ($placeholders as $name=>$value) {
if(is_array($value[0])) {
if ($value[0][1] != "*") {
$this->appendField($value[0][0],$value[0][1]);
} else {
//added these lines
$tstring = $value[0][0];
if(strpos($tstring,",")!==false){
$n = explode(",",$tstring);
foreach($n as $idtv){
$this->appendField($idtv,"backend");
$this->appendField($idtv,"display");
}
}else{
//end changes
$this->appendField($value[0][0],"backend");
$this->appendField($value[0][0],"display");
}
}
} else if(is_array($value)) {
$this->appendField($value[0],"display");
}
}
}
$ditto->fields with the fix
Array
(
[display] => Array
(
[db] => Array
(
[0 ] => id
[1] => published
[3] => pagetitle
)
[tv] => Array
(
[0 ] => thumbImg
[1] => typeRecette
[2] => tagsPhoto
)
[custom] => Array
(
[0] => title
)
[item] => Array
(
)
[qe] => Array
(
)
[phx] => Array
(
)
[rss] => Array
(
)
[json] => Array
(
)
[xml] => Array
(
)
[unknown] => Array
(
)
)
[backend] => Array
(
[tv] => Array
(
[0 ] => tagsPhoto
[1] => typeRecette
)
[db] => Array
(
[0 ] => id
[1] => published
)
)
)