From: Tim Otten Date: Mon, 24 Aug 2020 09:47:22 +0000 (-0700) Subject: CollectionAdderTrait - Use secondary ordering more akin to CRM_Core_Resources X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8b7abdb6cf4e15bc0b20c61435dc04f9db5d45b6;p=civicrm-core.git CollectionAdderTrait - Use secondary ordering more akin to CRM_Core_Resources This is a very subtle behavioral change. To understand it, we must consider the traditional ordering in `CRM_Core_Resources::addScriptUrl()` and `CRM_Core_Region::add()`. Compare these two examples: ``` Civi::resources()->addScriptUrl('http://example.com/foo.js', 100, 'page-footer'); Civi::resources()->addScriptUrl('http://example.com/bar.js', 100, 'page-footer'); CRM_Core_Region::instance('page-footer')->add([ 'scriptUrl' => 'http://example.com/foo.js', 'weight' => 100, ]); CRM_Core_Region::instance('page-footer')->add([ 'scriptUrl' => 'http://example.com/bar.js', 'weight' => 100, ]); ``` You might expect this to output `