CoreCommunity ExtensionsDistributionsFeature-RequestsTYPO3 6.2 Projects (+)(Archived Projects)

Bug #31183

Sorting field should grow slower

Added by Konrad almost 4 years ago. Updated 2 months ago.

Status:Resolved Start date:2011-10-21
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:Bug Spent time: 1.00 hour
Target version:- Estimated time:0.10 hour

Description

When adding new articles to product, they are added to the end of articles.
Now it's reached by multiplying highest existing sorting by 2 and setting as new attribute's sorting.
It makes 31th attribute to have maximum possible sorting (2 147 483 647) and further attributes have this maximum sorting too. It makes then unsortable.

I suggest changing multiplication to addition to solve the problem.

Path:

Index: class.tx_commerce_articlecreator.php
===================================================================
--- class.tx_commerce_articlecreator.php    (wersja )
+++ class.tx_commerce_articlecreator.php    (kopia robocza)
@@ -506,7 +506,7 @@
             'crdate' => time(),
             'title' => $this->createArticleTitleFromAttributes($PA, $key, $data),
             'uid_product' => $this->uid,
-            'sorting' => ($sorting['sorting'] *2),
+            'sorting' => ($sorting['sorting'] +20),
             'article_attributes' => count($this->attributes['rest']) +count($data),
             'attribute_hash' => $hash,
             'article_type_uid' => 1,
@@ -644,7 +644,7 @@
                     'uid_product' => $localisedProducts['uid'],
                     'sys_language_uid' => $localisedProducts['sys_language_uid'],
                     'l18n_parent' => $articleUid,
-                    'sorting' => ($sorting['sorting'] *2),
+                    'sorting' => ($sorting['sorting'] +20),
                     'article_attributes' => count($this->attributes['rest']) +count($data),
                     'attribute_hash' => $hash,
                     'article_type_uid' => 1,
Index: hooks/class.tx_commerce_tcehooksHandler.php
===================================================================
--- hooks/class.tx_commerce_tcehooksHandler.php    (wersja )
+++ hooks/class.tx_commerce_tcehooksHandler.php    (kopia robocza)
@@ -167,7 +167,7 @@
                         'uid_product' => intval($localisedProducts['uid']),
                         'sys_language_uid' => intval($localisedProducts['sys_language_uid']),
                         'l18n_parent' => intval($articleId),
-                        'sorting' => (intval($fieldArray['sorting']) *2),
+                        'sorting' => (intval($fieldArray['sorting']) +20),
                         'article_type_uid' => intval($fieldArray['article_type_uid']),
                     );

History

#1 Updated by Sebastian Fischer 2 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in branch 62055

Also available in: Atom PDF