Problem/Motivation

In the field admin interface, plugins are listed by weight but this weight is not used when calling the format callbacks because they are called by the alphabetical order of the plugins names. It works perfecttly with the given plugins because, magic, their names follow their weights (except for the organization one). This can lead to issues when using custom plugins to alter some fields (even if you don't want us to do this, we need to).

Proposed resolution

Use plugins weights instead of alphabetical order.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DuaelFr’s picture

Assigned: DuaelFr » Unassigned
Status: Active » Needs review
FileSize
872 bytes

This patch have no side effet.

jkuma’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, I update it to RTBC.

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

I had issues getting the patch to work, so I pushed a simpler version:
http://cgit.drupalcode.org/addressfield/commit/?id=2a338c9

Please test and let me know if you encounter any issues.

  • bojanz committed 2a338c9 on 7.x-1.x authored by DuaelFr
    Issue #2325411 by DuaelFr: Order plugins by weight instead of name
    
DuaelFr’s picture

Thank you Bojan.
I can't remember why I made it so complicated. I'd need to reinstall that project to make some tests but I don't think I'll have enough time for this on the next few weeks. I'll keep it in my inbox as a reminder, though.

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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