Hello,
I had a problem using extrafields for propal with sellist type : if I
want to use a WHERE clause, the sql request generated wasn't correct and
I had not my WHERE clause inside.
I have modified a line into extrafields.class.php and it seems to fix
this problem.
Usually, I make all my modifications of dolibarr in independant modules
to not lose my modifications on updates. But for this one, I was forced
to fix it directly from dolibarr core sources.
So I transmit to you my update, I hope it would be included to next release.
Michaël Luis.
diff -BNaur '--exclude=CVS' '--exclude=*.patch' '--exclude=.#*' '--exclude=*~' '--exclude=*.rej' '--exclude=*.orig' '--exclude=*.bak' '--exclude=conf.php' '--exclude=documents' original/htdocs/core/class/extrafields.class.php custom/htdocs/core/class/extrafields.class.php
--- original/htdocs/core/class/extrafields.class.php 2014-10-03 03:10:17.000000000 +0200
+++ custom/htdocs/core/class/extrafields.class.php 2014-12-23 15:16:35.116957800 +0100
@@ -751,7 +751,7 @@
}
}
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
- $sql.=preg_replace('/^ AND /','',$sqlwhere);
+ if (strlen($sqlwhere)) $sql.= ' WHERE ' . preg_replace('/^ AND /','',$sqlwhere);
//print $sql;
dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql);
_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev