WATCHDOG_EMERG was renamed to WATCHDOG_EMERGENCY but dblog-emerg to dblog-emergency not yet.

Comments

chx’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Reviewed & tested by the community

I doubt we want to change a class name in D7 past D 7.0 RC3. Otherwise, looks good.

rstamm’s picture

Issue tags: +consistency

I doubt that the class is used by a theme.

dries’s picture

Just a heads up: I'd like to commit #1136130: Regression: Reinstate WATCHDOG_* constants and document why they are necessary. first. This patch will likely need a re-roll after #1136130 lands.

dries’s picture

Status: Reviewed & tested by the community » Needs work

I committed #1136130: Regression: Reinstate WATCHDOG_* constants and document why they are necessary. so marking this patch 'needs work'. It will need a fairly simple re-roll.

rstamm’s picture

Status: Needs work » Needs review
StatusFileSize
new959 bytes

patch rerolled

tstoeckler’s picture

Now that we use the PHP constants I think we should strive for consistency with those.
So instead of renaming EMERG to EMERGENCY we should rename CRITICAL to CRIT and so forth, in my opinion.

jbrown’s picture

Title: Rename dblog-emerg to dblog-emergency » Make dblog css classes consistent with php constants
StatusFileSize
new2.41 KB
tstoeckler’s picture

Yes, that looks good. I'm inclined to mark this RTBC, but it could probably use another review. Also I didn't try this out locally. In theory, it could be tested that the CSS changes don't break anything, but I don't know if that's requried to get this committed.

rstamm’s picture

-1 not themer friendly, written out is better

jbrown’s picture

I'm happy either way.

kscheirer’s picture

-1 from me too - we just end up with less clear class names for themers.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Well this is simply about consistency. I think 'emergency' is clearer than 'emerg' both for developers and themers. But since PHP gives us 'emerg' we should go with that.

I guess this somehow got forgotten. Marking RTBC.

webchick’s picture

This smells like won't fix to me. Those classes are there for themers. Themers have no reason to be exposed to PHP internals.

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs review

Well at some point then you're going to have that inconsistency between 'emerg' == 'emergency', which is much more of a WTF than a 'emerg' in the first place. That's just me, though. Maybe back to needs review?

webchick’s picture

Well so far everyone who's reviewed it has said -1. :)

I guess we can leave it in needs review if you want, but until some themers jump in here and say "yes, please remove a semantic classname in favour of a non-semantic classname that leaks odd PHP internal behaviour" I don't see a compelling reason to commit this. The inconsistency argument doesn't make sense, because nowhere else do we abbreviate our class names like that. If anything, we make them longer and more descriptive than their respective raw data structure in order to provide clarity to front-end developers; for example:

#forum td.last-reply,

instead of:

#forum td.updated,

webchick’s picture

Component: dblog.module » CSS

Moving to the right component at any rate.

jacine’s picture

Don't like this patch at all. PHP != CSS and naming a class err, crit, emerg, or any other half-word over plain english that people reading it can clearly understand makes no sense to me. FTR, I think PHP is Doing it wrong™ too, but that doesn't mean we have to repeat those mistakes.

@Ralf's patch in #5 looks like the right fix here to me.

tstoeckler’s picture

Issue tags: +Novice

Alright then, who am I to argue :)
Patch #5 won't apply, though.
I grepped for 'dblog-emerg' and the following came up:

drupal-8.x-0/core/modules/dblog/dblog.test:541:      'dblog-emerg' => WATCHDOG_EMERGENCY,
drupal-8.x-0/core/modules/dblog/dblog.admin.inc:25:    WATCHDOG_EMERGENCY     => 'dblog-emerg',
drupal-8.x-0/core/modules/dblog/dblog.css:57:table#admin-dblog tr.dblog-emerg td.icon {

Marking as Novice together with these detailed instructions:

  1. Find the above lines in latest Drupal core 8.x (the number behind the filename is the line number).
  2. Change 'dblog-emerg' to 'dblog-emergency' in all 3 lines.
  3. Roll a patch (http://drupal.org/patch/create).
  4. Make webchick AND Jacine happy with your first ever core contribution!!! :)
schnippy’s picture

Ok - @BoJoe22 and are I rolling this up as our first core patch at the DC Learn Drupal Issue Sprint in Alexandria, VA (http://groups.drupal.org/node/235688)

tstoeckler’s picture

This looks good.
I didn't grep again (#18 is 4 months old), but I highly doubt any new use of these classes was introduced anywhere.
I didn't try this out locally, though, so I am not marking RTBC. Should be as easy visiting "admin/reports/dblog" and checking that all of the different error types are displayed correctly.

Btw, I checked where dblog.css is loaded and found this:
http://drupalcode.org/project/drupal.git/blob?f=core/modules/dblog/dblog...
We should probably open a follow-up to use #attached and rename the file to dblog.admin.css.

devin carlson’s picture

Category: bug » task
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new38.58 KB

The patch in #19 applied cleanly and successfully changed all occurrences of "dblog-emerg" to "dblog-emergency".

Attached is a screenshot of the log page demonstrating the "emergency" class (using a fake emergency message).

sun’s picture

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Novice, -consistency

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