Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell’s picture

Issue tags: +Novice

This should be an easy enough task.

effulgentsia’s picture

Status: Postponed » Active
Albert Volkman’s picture

Status: Active » Needs review
FileSize
36.12 KB

First pass. I didn't remove the actual drupal_attributes() array, I just updated the calls and documentation.

tim.plunkett’s picture

Status: Needs review » Needs work

Each file should have use Drupal\Core\Template\Attribute; at the top and refer to it as just "Attribute" inline.

Albert Volkman’s picture

Albert Volkman’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Status: Needs review » Needs work

The code conversion looks good, just some doc issues left:

+++ b/core/includes/common.incundefined
@@ -2296,7 +2298,8 @@ function drupal_attributes(array $attributes = array()) {
+ *     to work in a call to
+ *     Drupal\Core\Template\Attribute($options['attributes']).

I'm not sure that the wording makes as much sense now that it's a constructor and not a function.

+++ b/core/includes/form.incundefined
@@ -2794,7 +2795,8 @@ function theme_fieldset($variables) {
+ *       is currently done by passing all attributes to
+ *       Drupal\Core\Template\Attribute.

Same wording issue.

+++ b/core/lib/Drupal/Core/Template/Attribute.phpundefined
@@ -33,9 +33,9 @@ use IteratorAggregate;
  * Most of the time this object is not created directly, but
- * instantiated by drupal_attributes().
+ * instantiated by Drupal\Core\Template\Attribute.
  *
- * @see drupal_attributes()
+ * @see Drupal\Core\Template\Attribute

This should just be removed wholesale :)

+++ b/core/modules/field/field.moduleundefined
@@ -1107,17 +1108,17 @@ function template_process_field(&$variables, $hook) {
+  // here. For best performance, only call Drupal\Core\Template\Attribute when
+  // needed, and note that template_preprocess_field() does not initialize the

Same wording issue.

+++ b/core/modules/user/user.moduleundefined
@@ -1365,7 +1366,7 @@ function template_process_username(&$variables) {
  *   - attributes: An array of attributes to pass to the
- *     drupal_attributes() function if not linking to the user's page.
+ *     Drupal\Core\Template\Attribute class if not linking to the user's page.

Same wording issue.

Albert Volkman’s picture

Status: Needs work » Needs review
FileSize
3.64 KB
36.96 KB

Hopefully this is a bit better.

xjm’s picture

k_zoltan’s picture

Assigned: Unassigned » k_zoltan
Albert Volkman’s picture

Assigned: k_zoltan » Unassigned
FileSize
46.23 KB

Patch no longer applies. Re-roll against current head.

k_zoltan’s picture

Assigned: Unassigned » k_zoltan
k_zoltan’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed patch after re-roll. All seems to be fine.
The only place "drupal_attributes()" function remains it the "common.inc" where it is declared (although just as a wrapper for the new "Attributes" class.

k_zoltan’s picture

Assigned: k_zoltan » Unassigned
tstoeckler’s picture

Status: Reviewed & tested by the community » Needs work

Actually drupal_attributes() itself should also be removed. No need to keep a useless function around.

Cameron Tod’s picture

Status: Needs work » Needs review
FileSize
2.93 KB
47.92 KB

Removed drupal_attributes(), and rerolled the patch. Looks like some unrelated changes made it in to the last one, which have now been removed.

tstoeckler’s picture

Status: Needs review » Needs work
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php
@@ -42,9 +43,9 @@ class AttributesUnitTest extends UnitTestBase {
diff --git a/core/modules/system/system.admin-rtl.css b/core/modules/system/system.admin-rtl.css

+++ b/core/modules/system/system.admin-rtl.css
@@ -57,11 +57,11 @@ table.screenshot {
diff --git a/core/modules/system/system.admin.css b/core/modules/system/system.admin.css

+++ b/core/modules/system/system.admin.css
@@ -222,11 +223,11 @@ table.screenshot {
diff --git a/core/modules/system/system.base-rtl.css b/core/modules/system/system.base-rtl.css

+++ b/core/modules/system/system.base-rtl.css
@@ -40,13 +40,13 @@ a.tabledrag-handle .handle {
diff --git a/core/modules/system/system.base.css b/core/modules/system/system.base.css

+++ b/core/modules/system/system.base.css
@@ -170,7 +170,7 @@ table.sticky-header {
diff --git a/core/modules/system/system.maintenance.css b/core/modules/system/system.maintenance.css

+++ b/core/modules/system/system.maintenance.css
@@ -41,12 +41,12 @@
diff --git a/core/modules/system/system.theme-rtl.css b/core/modules/system/system.theme-rtl.css

+++ b/core/modules/system/system.theme-rtl.css
@@ -80,7 +80,7 @@ ul.primary li a {
diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css

While those are nice, they clearly are not related to this issue. :-)

Cameron Tod’s picture

Status: Needs work » Needs review
FileSize
14.15 KB
38.54 KB

Yikes! Hopefully this is ok.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

I had read this a couple times before, and I trust the interdiff (thanks for providing that!). RTBC. Cool stuff! :-)

catch’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Novice, +Drupal7AndTheArraysOfDoom

The last submitted patch, replace_drupal_attributes-1700382-18.patch, failed testing.

Cameron Tod’s picture

I will reroll this today if someone doesn't get to it first.

Cameron Tod’s picture

Status: Needs work » Needs review
FileSize
38.3 KB

Reroll.

Cameron Tod’s picture

Issue tags: +API change

Status: Needs review » Needs work

The last submitted patch, replace_drupal_attributes-1700382-23.patch, failed testing.

Cameron Tod’s picture

Status: Needs work » Needs review
FileSize
38.54 KB

what the

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Only reroll, back to RTBC.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

catch’s picture

Priority: Normal » Critical
Status: Fixed » Active

Hmm this isn't actually covered in [#1727592] - it doesn't mention that drupal_attributes() has been completely removed. Re-opening for the addition to the change notice.

Cameron Tod’s picture

Status: Active » Closed (fixed)

Added notes to the change record, see here: http://drupal.org/node/1727592/revisions/view/2293888/2336148

Hope it's ok for me to close this issue.

effulgentsia’s picture

Status: Closed (fixed) » Fixed

Thanks. Moving to "fixed" though to keep it in front of people watching open issues. The system will automatically move it to "closed (fixed)" after 2 weeks of no activity.

effulgentsia’s picture

Priority: Critical » Normal

Back to original priority. "critical" was only for the change notice.

jenlampton’s picture

Issue tags: +Twig

Adding tag.

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.