bshaffer / csdoctrineactassortableplugin Goto Github PK
View Code? Open in Web Editor NEWSortable behavior for Doctrine objects
License: Other
Sortable behavior for Doctrine objects
License: Other
Hi,
I am using your excellent Symfony plugin, but Im encountering an issue when Im deleting multiple records (with the sortable behaviour offcourse :) ).
Whenever I delete a big set with a Collection delete statement (e.g. $records_collection->delete(); ), I get the following error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6-27' for key 'answer_position_sortable_idx'
with the following stack trace:
It seems like a bug, so therefore Im creating this issue.
Hi, I´m getting the following error when calling $object->promote() from an action:
Fatal error: Call to undefined method Doctrine_Record_Listener_Chain::canUpdateWithOrderBy() in /Volumes/MacintosHD2/public_html/clientes/turiex/plugins/csDoctrineActAsSortablePlugin/lib/template/Sortable.php on line 407
Reverting to commit c19eb95 solves the issue.
Thank you for this great plugin, please help us fix this bug that won't let me go.
The README.md's Installation section describes the SVN external setup as
"csDoctrineActAsSortablePlugin https://svn.github.com/bshaffer/csDoctrineActAsSortablePlugin.git"
line should be added to SVN property. Is this URL surely valid? (I assume that not, because of the .git extension.)
I tried to load this URL in browser, but Error 500 has occurred.
Sorry if I'm wrong.
When using Sortable with SoftDelete it can't reorder the positions because the position of the deleted row is still exists and throws an sql error (position is a unique field).
So i added a new line to the beginning of postDelete():
public function postDelete(Doctrine_Event $event)
{
$fieldName = $this->_options['name'];
$object = $event->getInvoker();
$position = $object->$fieldName;
$conn = $object->getTable()->getConnection();
// quick FIX for softdelete + sortable conflict by [email protected]
$conn->execute("UPDATE ". $object->getTable()->getTableName() ." SET ". $fieldName ." = NULL WHERE id = ". $object->getId() ."");
...
}
In Doctrine_Template_Sortable::moveToPosition(), an ORDER BY clause is used within an 'UPDATE' request, which PostgreSQL (I use version 8.4.6) doesn't allow.
My workaround was to remove the '->orderBy(...)' lines in the function.
getting the following error
Fatal error: Call to undefined method Doctrine_Record_Listener_Chain::canUpdateWithOrderBy() in \plugins\csDoctrineActAsSortablePlugin\lib\template\Sortable.php on line 407
what trying to promote or demote from admin generator symfony 1.4
There is still a bug while updating a uniqueBy column :
If the uniqueBy column refer to a Parent object, on PostUpdate, the listener should refresh Positions for the OLD Parent children's.
Otherwise (just the case right now) the positions on the OLD Parent children's will contain a whole at the OldPosition of the modified object.
I have a model with two objects where one of them has a composite relation with the other. Both objects uses SoftDelete
, and the parent cascades the SoftDelete
to dependant objects that act as Sortable
.
The problem arrise when you delete one element of the parent object. I tryed adding the deleted_at
field to the uniqueBy
. But, as all the related objects have the same deleted_at
value, when the postDelete tries to reorder all the records, it throws a constraint violation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.