-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential issue: Wrong approach to default category position #281
Comments
We have successfully confirmed this issue for different scenarios (changing parent, rearranging within the same parent and deleting categories with siblings). I am still not sure what the bes approach would be. Perhaps preload the max(position) for each parent_id and then autoincrement it for each child that gets added? |
@barbazul Your suggested solution might solve the issue. Please create a PR to solve the issue :) You can create the PR on the develop branch. |
I ran into this as well and started thinking about preloading the max position. However that might prove difficult as you'd have to recalculate it if a category is moved to a new parent during the import. |
@mbijnsdorp I am not sure about leaving it at 0 would fix the issue. I think trouble beings when more than one category has a repeated position value, be it 0, 100000 or any other. @paales I have some spare time right now, I'll work on a PR and try to commit later tonight |
I created a new PR request with a more up to date version of @mbijnsdorp solution. Please consider it for merging as this issue has been open for over a year now |
I would love to have some feedback on this issue as I find myself with some spare time to work some more on this if needed |
Should I change the PR base branch to develop? |
In https://github.com/avstudnitz/AvS_FastSimpleImport/blob/master/src/app/code/community/AvS/FastSimpleImport/Model/Import/Entity/Category.php#L477 you are setting the category position to 10000 when it is not specified.
I am currently tracking an issue that apparently relates to this.
The symptoms are, after an import whenever I rearrange a category within its parent the new position gets set to 10001, sending it to the bottom.
Afterwards whenever I rearrange another category in the same parent, the first category gets reverted back to 10000 and the new category gets assigned to 10001.
This is because of the logic inside Mage_Catalog_Model_Resource_Category::_processPositions
I am unsure about how best to approach this issue. Suggestions?
The text was updated successfully, but these errors were encountered: