Closed haseganats closed 3 years ago
@haseganats could you post your composer show
? I'm unable to replicate this issue.
bramus/ansi-php 3.0.3 ANSI Control Functions and ANSI Control Sequences (Colors, Erasing, etc.) for PHP CLI Apps
bramus/monolog-colored-line-formatter 2.0.3 Colored Line Formatter for Monolog
composer/ca-bundle 1.2.8 Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
composer/installers v1.9.0 A multi-framework Composer library installer
dnadesign/silverstripe-elemental 4.4.1 Elemental pagetype and collection of Elements
doctrine/instantiator 1.3.1 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
embed/embed v3.4.9 PHP library to retrieve page info using oembed, opengraph, etc
guzzlehttp/psr7 1.7.0 PSR-7 message implementation that also provides common utility methods
intervention/image 2.5.1 Image handling and manipulation library with support for Laravel integration
league/csv 8.2.3 Csv data manipulation made easy in PHP
league/flysystem 1.0.70 Filesystem abstraction: Many filesystems, one API.
m1/env 2.2.0 Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env fil...
marcj/topsort 1.1.0 High-Performance TopSort/Dependency resolving algorithm
monolog/monolog 1.25.5 Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy 1.10.1 Create deep copies (clones) of your objects
nikic/php-parser v4.10.2 A PHP parser written in PHP
phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 5.2.2 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that...
phpdocumentor/type-resolver 1.4.0 A PSR-5 based resolver of Class names, Types and Structural Element Names
phpspec/prophecy v1.10.3 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 4.0.8 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 1.4.5 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.9 Utility class for timing
phpunit/php-token-stream 2.0.2 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 5.7.27 The PHP Unit Testing framework.
psr/cache 1.0.1 Common interface for caching libraries
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.1.3 Common interface for logging libraries
psr/simple-cache 1.0.1 Common interfaces for simple caching
ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 1.2.4 Provides the functionality to compare PHP values for equality
sebastian/diff 1.4.3 Diff implementation
sebastian/environment 2.0.0 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 2.0.0 Provides the functionality to export PHP variables for visualization
sebastian/global-state 1.1.1 Snapshotting of global state
sebastian/object-enumerator 2.0.1 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/recursion-context 2.0.0 Provides functionality to recursively process PHP variables
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
silverstripe/admin 1.6.1 SilverStripe admin interface
silverstripe/asset-admin 1.6.1 Asset management for the SilverStripe CMS
silverstripe/assets 1.6.1 SilverStripe Assets component
silverstripe/campaign-admin 1.6.0 SilverStripe campaign admin interface
silverstripe/cms 4.6.0 The SilverStripe Content Management System
silverstripe/config 1.0.18 SilverStripe configuration based on YAML and class statics
silverstripe/errorpage 1.6.0 ErrorPage component for SilverStripe CMS
silverstripe/framework 4.6.2 The SilverStripe framework
silverstripe/graphql 3.3.0 GraphQL server for SilverStripe models and other data
silverstripe/login-forms 4.1.2 A collection of templates for the CMS login screens
silverstripe/mimevalidator 2.0.0 Checks uploaded file content roughly matches a known MIME type for the file extension.
silverstripe/recipe-cms 4.6.1 SilverStripe recipe for fully featured page and asset content editing
silverstripe/recipe-core 4.6.1 SilverStripe framework-only core recipe
silverstripe/recipe-plugin 1.4.0 Helper plugin to install SilverStripe recipes
silverstripe/reports 4.6.0 Reports module for SilverStripe CMS
silverstripe/siteconfig 4.6.0 Site wide settings administration.
silverstripe/spamprotection 3.0.2 Spam protection module for SilverStripe.
silverstripe/vendor-plugin 1.5.1 Allows vendor modules to expose directories to the webroot
silverstripe/versioned 1.6.2 SilverStripe Versioned component
silverstripe/versioned-admin 1.6.0 SilverStripe versioned admin interface
sminnee/phpunit-mock-objects 3.4.10 Mock Object library for PHPUnit (fork to add PHP 7.4 support to 3.4)
sunnysideup/email_address_database_field 2.0.0 E-mail address database field for the Silverstripe CMS
sunnysideup/error-log-made-easy dev-master 15ec0c0 Set up error logging on your silverstripe website: emails every error to a designated email.
sunnysideup/phone_field 2.0.2 Silverstripe Module that adds a phone field to your database field options, such as Varchar and HTMLText
swiftmailer/swiftmailer v5.4.12 Swiftmailer, free feature-rich PHP mailer
symbiote/silverstripe-gridfieldextensions 3.2.4 A collection of useful grid field components
symfony/cache v3.4.46 Symfony Cache component with PSR-6, PSR-16, and tags
symfony/config v3.4.46 Symfony Config Component
symfony/filesystem v4.4.16 Symfony Filesystem Component
symfony/finder v3.4.46 Symfony Finder Component
symfony/polyfill-apcu v1.20.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-ctype v1.20.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring v1.20.0 Symfony polyfill for the Mbstring extension
symfony/translation v2.8.52 Symfony Translation Component
symfony/yaml v3.4.46 Symfony Yaml Component
webmozart/assert 1.9.1 Assertions to validate method input/output with nice error messages.
webonyx/graphql-php v0.12.6 A PHP port of GraphQL reference implementation
@haseganats could you post your
composer show
? I'm unable to replicate this issue.
Hi, see above
Same issue here. I have to manually publish the whole page to save the order of elements. But then all archived Elements are published too.
Cannot replicated with elemental 4.6.x-dev and framework 4.8.x-dev using 5x regular Content blocks
I've tried page save + publish and inline block save + publish, everything works as expected
We'll need further replication steps in order to do anything here
THANK YOU for checking.
@emteknetnz @brynwhyman I have experienced this issue, but it is only seen if you (somehow) enter a state where you have multiple blocks with the same Sort
value.
For me, this was caused by fixtures generation.
$block = ElementContent::create();
$block->write();
$page->ElementalArea()->add($block);
ParentID
, so a Sort
of 1
is written to it.ElementalArea
, the Sort
is not updated.Sort: 1
.When we trigger ReorderElements::reorder()
, it fetches $afterElement
and stores the current Sort
(which is 1
) to the variable $sortAfterPosition
, we then get down to the condition where we determine how we wish to update the current record.
We skip past the first condition, because $sortAfterPosition
is not less than $currentPosition
, which means we set $newBlockPosition
to $sortAfterPosition
, which is of course, the same position.
I think that a lot of these potential scenarios could be avoided if we only set a default Sort
value once a ParentID
exists.
I'm not sure if there is any downside to this?
My other thought is whether we need something somewhere that catches theses duplicate Sort
values and .. .. sorts them out (sorry). But then I'm unsure when the best time to do that would be. Page publish is risky, as you might end up changing to sort of items to something unexpected.
Ahh, this came up in a different PR too, here: https://github.com/silverstripe/silverstripe-elemental/pull/931
@chrispenny, might that PR be an answer to your question about sorting-the-sort?
Yea, I think the comments there are fair (and are similar to what I mentioned above about "not knowing when a good time to re-order is"). I've added a note on that PR 😃
I think that a lot of these potential scenarios could be avoided if we only set a default Sort value once a ParentID exists.
I think this makes a lot of sense. I'd welcome a PR to implement this.
My other thought is whether we need something somewhere that catches theses duplicate Sort values and .. .. sorts them out (sorry).
Yeah as I said on the other issue, I'd prefer to deal with situations where the sort order is breaking, rather than some process that will audit and rearrange. The problems with the latter is that rearranging the elements automatically doesn't guarantee an order that the content author actually wants, and it's an expensive operation that we should not put somewhere as a side-effect.
If we have it, I'd like "reorder everything" to be an action that's performed with intent. We'd need to figure out why a content author would see it as a problem, and come up with a mechanism to let them fix it.
If there are other scenarios that cause inconsistencies in sorting, please raise new issues. Thanks!
We did a fresh install of elemental using SS4.6 and latest version of Elemental. What we found is that if move a block from bottom position up by one using the drag and drop UX, it works fine, BUT it does not save (i.e. when we save and publish the block is back in its original position). This does not happen if:
a. block is moved up more than one position b. block is not move from bottom position (i.e. there is/are other blocks below it).
Note: further replication steps in comment below