heimrichhannot / contao-utils-bundle

This bundle offers various utility functionality for the Contao CMS.
GNU Lesser General Public License v3.0
8 stars 4 forks source link

Dca::aliasExist is allways false #33

Closed AlexejKossmann closed 3 years ago

AlexejKossmann commented 3 years ago

Context Contao version: 4.9 Bundle version: latest PHP version: 7.4

Description The method Dca::aliasExist allways return false because https://github.com/heimrichhannot/contao-utils-bundle/blob/bd318f728ed05b3ffafdb6742eaeef0359a7cf7a/src/Dca/DcaUtil.php#L661

creates statement: "SELECT id FROM tl_ml_product WHERE ' . $aliasField . '=? AND id!=?"

i consider to change it to: $stmt = $this->connection->prepare("SELECT id FROM {$table} WHERE {$aliasField}=? AND id!=?");

@Defcon0 @koertho what do you think?

koertho commented 3 years ago

Yeah. Or just change ' to " :smile: As you like it ;)

AlexejKossmann commented 3 years ago

@koertho Yea, but i think its ugly to have different variable insertion in a single statement

Defcon0 commented 3 years ago

Please change it to having only double quotes.