Problem/Motivation

On admin page you can order flags (set weight), but weigh it not used when flags are displayed in entity links.

Issue fork flag-3565558

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dotpex created an issue. See original summary.

ivnish’s picture

Version: 5.0.3 » 5.x-dev
ivnish’s picture

Status: Active » Needs review
deaom’s picture

If I understand correctly the issue is the links are not displayed in the order set in admin page when viewing the node?
The code in the MR does not solve the issue for entities that have the manage display where the order is handled. So not sure if this is needed? As the ordering of flags on admin page does not handle the display order? Will let maintainers decide as I'm not sure I even understand the issue correctly.

dotpex’s picture

@Dea yes you understand issue correctly, it's about entity links, this change just add sort on query and does not affect order of fields when you configure flags as fields.

deaom’s picture

Test would be needed to demonstrate this behavior as I can confirm the query does sort when looking with debugger, but do not see that output on nodes.

dotpex’s picture

StatusFileSize
new95.87 KB
new413 bytes

Hi @Dea sorry I don't have a time to write test, I already spend too much time for this and it's basically one line added. On project I'm working on this work fine for set of flags that are configured to be displayed in entity links and have no effect for other flags that are configured "Display link as field".
I attached screenshot of config and patch if someone else have same issue.

deaom’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I'll see if I can write a test based on additional explanation. It's not a big change as it's just adding an order to a query, so nothing should break with this patch, as manage display is still working as expected (tested manually). Will change status to needs work for the test, but maintainers can decide if this can be merged without one.

deaom’s picture

Status: Needs work » Needs review

Added test for inline links to showcase weights are now working as the inline links are getting sorted based on what's set in the admin/structure/flag. Ready for review.

ivnish’s picture

Issue tags: -Needs tests

  • ivnish committed cfeaec61 on 5.x authored by dotpex
    fix: #3565558 Flags are not sorted by weight in entity links
    
    By: dotpex...
ivnish’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.