The page is multilingual (Hungarian and English). You create a product with TEFAL XY Hungarian and TEFAL XY English tilte (the same title used in each language). You can saved the form / object, it created successfully. Now you change the Hungarian title to TEFAL X. Save. Then change the English title to TEFAL X, too. You will get an error:
Doctrine: SQLSTATE[23000]: Integrity constraint violation duplicate entry
This is a bug in doctrine 1.2.x.
Solution
- Copy lib / vendor / symfony / lib / plugins / sfDoctrinePlugin / lib / vendor / doctrine / Doctrine / Template / Listener / Sluggable.php inside your own lib directory.
- In the getUniqueSlug method, change this line:
$whereString .= ' AND r.' . implode(' != ? AND r.', $table->getIdentifierColumnNames()) . ' != ?';
to this:
$whereString .= ' AND (r.' . implode(' != ? OR r.', $table->getIdentifierColumnNames()) . ' != ?)'; - Save. Clear cache. Be happy.
No comments:
Post a Comment