Comments

joachim created an issue. See original summary.

joachim’s picture

pvsureshmca’s picture

Assigned: Unassigned » pvsureshmca
pvsureshmca’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new63.35 KB
new48.36 KB

@joachim,

Thanks for your contribution. Given patch is working as expected to me. Please refer the attached image for more reference.

Thank you.

pvsureshmca’s picture

Assigned: pvsureshmca » Unassigned

Status: Reviewed & tested by the community » Needs work
joachim’s picture

Status: Needs work » Reviewed & tested by the community

> 1) Drupal\Tests\rest\Functional\EntityResource\User\UserXmlBasicAuthTest::testPost
Exception: Warning: apcu_store(): Unable to allocate memory for pool.
Symfony\Component\ClassLoader\ApcClassLoader->findFile()() (Line: 128)

That's a problem with the test runner.

larowlan’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

If this is something we care about, we need a test

Thanks

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joachim’s picture

I'm not sure how a test is going to work here. We can assert the items are in order, but it could always be the case that it's a fluke and they just happen to have been loaded in that order.

> If this is something we care about, we need a test

Also, yes we do. On a site with custom entity types, Commerce, etc, this list is huge. Finding the entity type you want becomes a real pain.

Rajender Rajan’s picture

Rajender Rajan’s picture

Status: Needs work » Needs review
lendude’s picture

Title: select element options for the view base table in the 'add view' form are unsorted » Entity names in the 'add view' form are unsorted
Issue summary: View changes
Issue tags: +Needs usability review
StatusFileSize
new65.39 KB
new53.42 KB
new246.22 KB
new249 KB

Fixing this makes sense to me, but the fix in 11 still doesn't look right because we are sorting on objects I suspect. Casting the titles to strings makes it look good.

Expanded the IS, added some screenshots and some title clean up.

Still needs tests.

Also not 100% convinced this is the best we can do. Using the example of commerce, it might be nice to group entities by package or something. But maybe alphabetically is a good first step...

joachim’s picture

> Also not 100% convinced this is the best we can do. Using the example of commerce, it might be nice to group entities by package or something. But maybe alphabetically is a good first step...

The perfect is the enemy of the good!

At the moment, this dropdown is a UX bug. Getting it alphabetical means it's actually usable. We can make it even better in a future issue :)

lendude’s picture

Issue tags: -Needs tests
StatusFileSize
new1.4 KB
new2.07 KB

Here is a test for this. Test only file is the interdiff.

The last submitted patch, 15: 2932016-15-TEST_ONLY.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

amietpatial’s picture

StatusFileSize
new93.88 KB
new94.98 KB

HI Lendude I have applied your patch successfully it's showing sorted content now

joachim’s picture

Looks good, though should we use natcasesort() here?

Granted, it's highly unlikely that an entity type's label will have a lowercase first letter.

What's the difference between asort() and natsort()?

chanderbhushan’s picture

@joachim

The asort() function sorts an associative array in ascending order, according to the value
AND
The natsort() function sorts an array by using a "natural order" algorithm. The values keep their original keys.

example :- In a natural algorithm, the number 2 is less than the number 10. In computer sorting, 10 is less than 2, because the first number in "10" is less than 2.

joachim’s picture

Status: Needs review » Needs work

I think we should use natcasesort. It's unlikely, but it's possible, that entity types could be called things like 'iPad Models', or 'Level 10 items'.

chanderbhushan’s picture

Status: Needs work » Needs review
StatusFileSize
new556 bytes

@joachim applied patch for same. thanks

lendude’s picture

Status: Needs review » Needs work

@chanderbhushan thanks! but can we get the test coverage in the patch too?

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Kumar Kundan’s picture

Assigned: Unassigned » Kumar Kundan
Kumar Kundan’s picture

StatusFileSize
new556 bytes
new4.27 KB
Kumar Kundan’s picture

StatusFileSize
new4.27 KB
new3.99 KB
Kumar Kundan’s picture

Assigned: Kumar Kundan » Unassigned
Status: Needs work » Needs review
joachim’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for writing the test!

I'd say this is ready.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/views_ui/tests/src/Functional/WizardTest.php
@@ -64,4 +64,103 @@ public function testWizardFieldLength() {
+    \Drupal::service('module_installer')->install(['taxonomy']);
...
+    // Installing comment module.
+    \Drupal::service('module_installer')->install(['comment']);
...
+    \Drupal::service('module_installer')->install(['file']);
+    \Drupal::service('module_installer')->install(['block_content']);

Let's install all these modules in one go and then do one assert. The piecemeal install doesn't really prove too much. Note that ->install() takes a list of all modules to install so it's only necessary to have a single call.

Kumar Kundan’s picture

Assigned: Unassigned » Kumar Kundan
Kumar Kundan’s picture

StatusFileSize
new2.63 KB
new2.35 KB

Thanks to @alexpott for reviewing the patch.

Kumar Kundan’s picture

Assigned: Kumar Kundan » Unassigned
Status: Needs work » Needs review
tanubansal’s picture

StatusFileSize
new261.91 KB

Tested via above mentioned steps and latest patch. This can be moved to RTBC

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

benjifisher’s picture

I did not find this issue when I created #3183106: Sort the options in the "Add view" wizard. One of these issues should be closed as a duplicate.

Even though this issue is older, I suggest closing it since the approach used on the other issue is simpler. As I said in #3183106-1: Sort the options in the "Add view" wizard,

I believe that the test coverage in #3065903: Add label sort ability to Select element is good enough that we can just use the new sort_options attribute here without adding any new tests.

If I remember correctly, a lot of effort went into #3065903: Add label sort ability to Select element to make sure that the sort is done at the correct time. I do not think there are any variable substitutions in this use case, but has anyone tested the patch here with translations?

If no one objects, then I will close this issue as a duplicate and transfer the issue credits to #3183106.

alexpott’s picture

Status: Needs review » Closed (duplicate)

Closing in favour of the other issue. I've transferred issue credit.