Problem/Motivation

"Unpublished" style of rendered entities is not accessible (pink too hard to notice for some) (and looks bad)

blocks #2290101: UI telling you a field is shared across languages is way too subtle

Bug because there is an accessibility violation. Even for sighted people with good vision, the light pink background is difficult to see. For someone with low vision, there is no distinction. For someone using a mobile device outside, they won't be able to distinguish between published and unpublished content. For a blind user, there is no indication that a node is unpublished.

Major because this is a basic part of Drupal Core's workflow and it isn't accessible. This doesn't meet WCAG 2.0 AA, but also presents usability challenges.

Proposed resolution

Add a marker to nodes & comments to ensure that the published/unpublished state is semantically defined.

Enhance the visual representation of the unpublished content so that it is more distinct.

Remaining tasks

  • Update the patch so the marker is properly output for both nodes and comments that are unpublished in the Bartik, Stark, and Claro themes following the approach taken in patch #275 (https://www.drupal.org/project/drupal/issues/867830#comment-13839909)

    Currently, the markers are being output only for unpublished nodes in Bartik articles and comments in Stark. The marker should be output for all unpublished nodes and comments on all frontend themes. That is, all the no's in the table below should become all yes'.

    Current status of marker output with patch #275
    Theme/Node Node Comment
    Bartik - Basic Page no no
    Bartik - Article yes no
    Stark - Basic Page no yes
    Stark - Article no yes
    Claro - Basic Page no no
    Claro - Article no no

    Output should include hidden text to give screen reader users context to for the status marker:

    <span class="marker marker--warning">
        <span class="visually-hidden">This node is</span> 
            Unpublished
    </span>
    

    Note: Current output in the stark theme with patch #275 uses the <mark> element. This should be changed to the spans with visually hidden context above. The <mark> element was moved to https://www.drupal.org/project/drupal/issues/1311372.

  • Update patch to get tests passing
  • To be discussed: The colors for marker warnings used in the latest patch (#275) do not pass WCAG guidelines for color contrast. (Success marker has ratio of 2.53:1 and warning marker has ratio of 2.46:1. Ratio should be at least 4.5:1.) Maybe this is part of a design already approved elsewhere and is out of scope of this issue? Otherwise, if these colors are being newly introduced with this issue, they should be revised for accessibility.

User interface changes

CSS changes.

before

This example has an unpublished node, with an unpublished comment.

after

Unpublished comments:

Unpublished nodes:
Screenshot needed once it's working in patch.

API changes

None.

Original report by @joshk

I really like this change: #394736: Unpublished node's pink background unclear

As the pink background is just too hard too see. This is the same issue as for unpublished comments as well!

Why this change should be committed during RC

A color based signifier for content state is not accessible or intuitive for any users.

CommentFileSizeAuthor
#308 Screenshot 2025-07-16 at 19.25.10.png126.38 KBmarkconroy
#304 867830-304.patch17.5 KBvsujeetkumar
#296 interdiff_293-296.txt1.03 KBvsujeetkumar
#296 867830-296.patch33.96 KBvsujeetkumar
#293 interdiff_291-293.txt15.7 KBvsujeetkumar
#293 867830-293.patch34.48 KBvsujeetkumar
#291 interdiff_290-291.txt763 bytesvsujeetkumar
#291 867830-291.patch19.22 KBvsujeetkumar
#290 867830-290.patch19.19 KBvsujeetkumar
#281 interdiff_275_281.txt2.79 KBanmolgoyal74
#281 unpublished_status_of-867830-281.patch19.08 KBanmolgoyal74
#275 unpublished_status_of-867830-275.patch18.21 KBlolcode
#259 unpublished-in-bartik.png81.7 KByoroy
#258 interdiff.txt1.16 KBmanuel garcia
#258 unpublished_status_of-867830-258.patch18.08 KBmanuel garcia
#256 after.png74.88 KBemma.maria
#256 before.png77.29 KBemma.maria
#254 interdiff-867830-245-254.txt1.92 KBeiriksm
#254 unpublished_status_of-867830-254.patch18.03 KBeiriksm
#245 interdiff-867830-229-245.txt472 bytesrootwork
#245 867830-245.patch17.82 KBrootwork
#229 interdiff.txt967 byteseiriksm
#229 unpublished_status_of-867830-229.patch18.07 KBeiriksm
#227 interdiff-867830-222-227.txt879 byteseiriksm
#227 unpublished_status_of-867830-227.patch17.4 KBeiriksm
#223 Screenshot 2015-10-07 19.35.18.jpg496.64 KBlewisnyman
#223 Screenshot 2015-10-07 19.34.37.jpg533 KBlewisnyman
#223 Screenshot 2015-10-07 19.34.53.jpg343.23 KBlewisnyman
#222 unpublished_status_of-867830-222.patch16.54 KBlewisnyman
#222 interdiff.txt2.38 KBlewisnyman
#220 unpublished-node-comment.png184.89 KByesct
#217 interdiff.txt4.04 KBstrykaizer
#217 unpublished_status_of-867830-217.patch16.66 KBstrykaizer
#215 interdiff.txt4.07 KBstrykaizer
#215 unpublished_status_of-867830-215.patch0 bytesstrykaizer
#213 202-213-interdiff.txt413 bytesMaouna
#213 unpublished_status_of-867830-213.patch16.12 KBMaouna
#202 unpublished_status_of-867830-202.patch16.79 KBnlisgo
#202 interdiff-867830-197-202.txt1.44 KBnlisgo
#201 20975812044_63805631e1_o.png121.32 KBmgifford
#201 21411510729_8aea147770_o.png102.86 KBmgifford
#201 comments.png22.94 KBmgifford
#197 unpublished_status_of-867830-197.patch15.89 KBthewilkybarkid
#197 interdiff-867830-196-197.txt2.32 KBthewilkybarkid
#196 unpublished_status_of-867830-196.patch13.57 KBnlisgo
#196 interdiff-867830-188-196.txt628 bytesnlisgo
#188 unpublished_status_of-867830-188.patch13.56 KBlewisnyman
#188 interdiff.txt11.42 KBlewisnyman
#186 Screenshot 2015-09-20 15.37.38.jpg489.11 KBlewisnyman
#186 unpublished_status_of-867830-186.patch18.46 KBlewisnyman
#186 interdiff.txt16.05 KBlewisnyman
#181 unpublished_status_of-867830-181.patch8.68 KBemma.maria
#165 interdiff.txt517 bytesgoogletorp
#165 867830-164.patch8.38 KBgoogletorp
#163 Screenshot 2015-09-12 20.15.05.jpg509.32 KBlewisnyman
#163 unpublished_status_of-867830-163.patch8.51 KBlewisnyman
#153 Screenshot 2015-09-10 17.55.02.jpg568.19 KBlewisnyman
#152 JustPink.png9.47 KBmgifford
#152 Npublish-Unpub.png34.47 KBmgifford
#151 interdiff.txt437 bytesmanuel garcia
#151 unpublished_status_of-867830-151.patch7.09 KBmanuel garcia
#149 unpublished_status_of-867830-149.patch7.16 KBhussainweb
#149 interdiff-147-149.txt1.46 KBhussainweb
#147 unpublished_status_of-867830-147.patch7.13 KBmanuel garcia
#140 unpublished.png103.79 KBmgifford
#138 comments-node-unpublished-with-style-867830-138.patch5.06 KBakalata
#133 comments-node-unpublished-with-style-867830-132.patch5.63 KBmanuel garcia
#125 comments-node-unpublished-with-style-867830-125.patch6.14 KBmgifford
#124 Screen Shot 2014-09-08 at 7.14.02 AM.png69.91 KBmgifford
#124 comments-node-unpublished-with-style-867830-124.patch5.33 KBmgifford
#123 comments-node-unpublished-with-style-867830-123.patch4.26 KBmgifford
#119 comments-node-unpublished-with-style-867830-119.patch4.3 KBmgifford
#118 Screen Shot 2014-08-10 at 4.32.52 PM.png55.07 KBmgifford
#117 comments-node-unpublished-867830-117.patch2.98 KBmgifford
#116 comments-node-unpublished-867830-116.patch2.98 KBmgifford
#112 comments-node-unpublished-867830-112.patch2.98 KBpcorbett
#110 Screen Shot 2014-07-18 at 2.16.03 PM.png35.68 KBmgifford
#107 comments-node-unpublished-867830-107.patch2.96 KBmgifford
#103 comments-node-unpublished-867830-103.patch2.92 KBmgifford
#96 comments-node-unpublished-867830-96.patch2.92 KBmgifford
#92 comments-node-unpublished-867830-92.patch3.4 KBmgifford
#88 comments-node-unpublished-867830-87.patch3.38 KBmgifford
#87 comments-node-unpublished-867830-87.patch3.38 KBmgifford
#84 comments-node-unpublished-867830-84.patch3.2 KBmgifford
#80 comments-node-unpublished-867830-77-nowhitespace-errors.patch3.41 KBmgifford
#77 comments-node-unpublished-867830-77.patch3.42 KBmgifford
#70 Screen Shot 2013-03-22 at 8.05.37 AM.png20.45 KBmgifford
#69 comments-node-unpublished-867830-69.patch3.42 KBmicnap
#68 Marker4UnpublishedNode.png122.98 KBmgifford
#67 comments-node-unpublished-867830-67.patch3.47 KBPete B
#64 comments-node-unpublished-867830-64.patch3.47 KBPete B
#59 comments-node-unpublished-867830-59.patch3.22 KBPete B
#58 comment-node-unpublished-867830-58.patch3.17 KBmgifford
#55 comment-node-unpublished-867830-55.patch3.19 KBmgifford
#51 comment-node-unpublished-867830-51.patch3.08 KBmgifford
#48 comment-node-unpublished-867830-48.patch3.11 KBmgifford
#46 comment-node-unpublished-867830-46.patch3.11 KBmgifford
#25 unpublished_consolidated_1.patch4.4 KBmgifford
#12 unpublished_no_font_4em.png10.52 KBmgifford
#9 bartik-1-comment.png53.67 KBjacine
#9 bartik-2-comments.png62.2 KBjacine
#3 comments-unpublished.patch3.05 KBjoshk
#3 bartik-before.png67.86 KBjoshk
#3 bartik-after.png74.16 KBjoshk
#3 garland-after.png64.66 KBjoshk
#3 stark-after.png70.65 KBjoshk

Issue fork drupal-867830

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

joshk’s picture

Issue tags: +Usability

Confirmed that comment.css is still using that old dusty-pink style. I will roll a patch tonight!

yoroy’s picture

Please do :)

joshk’s picture

StatusFileSize
new70.65 KB
new64.66 KB
new74.16 KB
new67.86 KB
new3.05 KB

Ok, got distracted. Here's the patch, plus the before/after screenshots in Bartik, plus working shots from Garland and Stark.

It uses exactly the same technique as the node upublished technique.

yoroy’s picture

Status: Needs work » Needs review

bot?

dries’s picture

I agree that 'pink' doesn't communicate 'unpublished'.

yoroy’s picture

Status: Needs review » Reviewed & tested by the community

It works even with one-line comments: http://skitch.com/yoroy/dxrb2/test-d7

sun’s picture

#3: comments-unpublished.patch queued for re-testing.

jacine’s picture

Status: Reviewed & tested by the community » Needs review

I'm against this, unless the code is moved to theme(s) or a less intrusive solution can be agreed upon. Here's why:

  • It's too design-specific for core
  • It makes the cardinal sin of defining a font-family and colors, among other things in a core module's CSS file
  • It will fail hard on any background other than white
  • As pictured in #6, it will also fail when dealing with threaded comments and two filled sidebars
  • It's also likely to fail with other translations of "unpublished" if the word ends up being much longer

This will result in unnecessary overrides for template files and CSS for many themes. We have a .comment-unpublished class, and we have easily editable template files, so why can't we just let themes decide how they want to style this?

If we must do something here, is there anything less intrusive we can do to communicate this status clearly?

I also do not see this #394736: Unpublished node's pink background unclear as having been committed.

jacine’s picture

StatusFileSize
new62.2 KB
new53.67 KB

Actually, it fails out of the box with 2 sidebars.

Jeff Burnz’s picture

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

The textual message is good because it solves a nasty accessibility issue that there is no non-visual indicator of unpublished content - however themes should set the design for this, not a core module.

mgifford’s picture

Issue tags: +Accessibility

tagging

mgifford’s picture

StatusFileSize
new10.52 KB

@Jacine - Thanks!
#8-2 with the fonts, the blocks module defines a font-family too modules/block/block.css: font-family: "Lucida Grande", Verdana, sans-serif;
#8-3 I think it would work fine with a black background. It certainly would be more visible than the existing pink background for anything other than the same gray used with the text.. For most backgrounds it would be much more visible than what is there now.
#8-5 I wonder if the font size could be smaller for the comments too. We should have translations for unpublished in many different languages. I wonder if there is a way to simply compile all of the known translations for string length.
#9 this would also be a problem with #394736: Unpublished node's pink background unclear then I assume.

This text is key for visually impaired people to be able to understand the difference between published & unpublished comments:

<div class="unpublished"><?php print t('Unpublished'); ?></div>

How do we get that in while encouraging themes to decide how best to style this?

Most of the controversy is around the css, so just focusing on the CSS, what if we nix the font & reduce the size of the text to 4em's:

Index: modules/comment/comment.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.css,v
retrieving revision 1.5
diff -u -r1.5 comment.css
--- modules/comment/comment.css 31 Dec 2008 12:02:21 -0000      1.5
+++ modules/comment/comment.css 1 Aug 2010 23:37:24 -0000
@@ -6,8 +6,19 @@
 .indented {
   margin-left: 25px; /* LTR */
 }
-.comment-unpublished {
-  background-color: #fff4f4;
+.comment-unpublished div.unpublished {
+  height: 0;
+  overflow: visible;
+  color: #d8d8d8;
+  font-size: 4em;
+  line-height: 1;
+  font-weight: bold;
+  text-transform: uppercase;
+  text-align: center;
+}
+.preview .comment div.unpublished {
+  display: none;
 }
 .preview .comment {
   background-color: #ffffea;
sun’s picture

Title: Unpublished comments should get the same UI treatment as nodes » "unpublished" status of rendered entities is not accessible

Better title.

What we will do for D7 is the following:

+++ modules/comment/comment.tpl.php	1 Aug 2010 23:37:24 -0000
@@ -76,6 +76,10 @@
+    <?php if ($status == 'comment-unpublished'): ?>
+      <div class="unpublished"><?php print t('Unpublished'); ?></div>
+    <?php endif; ?>

1) We only add that textual representation of the unpublished status, and only that, and with the usual .element-invisible class applied to it.

2) We move that output into a proper theme function, and we make it generic. I.e., to make this crystal clear: theme_unpublished_marker() [or similar] produces always the same output, regardless of whether for nodes or comments or whatnot, and always has the .element-invisible class (set by the theme function), and optionally an additional, generic "unpublished" class. The template only contains a template variable. The themed output is prepared and generated as usual in the template preprocessor, depending on the respective entity's status.

3) Zero, absolutely none CSS styles go into D7 core for this.

Lastly, since the old issue title somehow suggested that there was or is some existing stuff for nodes already, and if there actually is something, then we are reverting that here to make this consistent.

sun’s picture

Component: comment.module » markup
Category: feature » bug

Proper category and component.

Jeff Burnz’s picture

1) Why hide this, seems this information is useful to everyone not just screen reader users. For screen readers it needs context, i.e. a heading, dumping the word "Unpublished" in a node or comment may not be useful if its not contextualized.

2) Agree, but, can we get that into D7 - we need to fix but can we do it properly or will we need a hacky solution for D7 (strait in the tpl's)

3) Agree - zero CSS in modue css for this.

Looks like there was no commit for the node template stuff so I marked #394736 as a duplicate in favor of cleaning it all up in one issue.

sun’s picture

For screen readers it needs context, i.e. a heading, dumping the word "Unpublished" in a node or comment may not be useful if its not contextualized.

Am I missing something? I thought the whole purpose of this issue was to fix accessibility of unpublished entities (comments), which are currently just colorized...?

The list was meant additive, i.e., we do all of (1) to (3), but we don't change the existing visual behavior/look. We merely and solely fix the accessibility bug.

By introducing a theme function and standardizing its usage in templates, themes are free to override that and do whatever they want, but D7 core will not. D7 core will just fix the accessibility bug.

Jeff Burnz’s picture

The original issue was just that pink was not a good indicator of status so the proposal was to add text as well, the problem with the node and comment patches are the styles & for screen readers the "message" would have no context - the screen reader user could learn that hearing the word "unpublished" when viewing node and comments means something important. Its better if we hide a heading above it just for screen reader users.

So the issue as I see it pans out to several things:

1. Color alone is not sufficient indicator of status, and a WCAG violation (for sighted users).
2. A simple message with no context is difficult/problematic for screen reader users.

sun’s picture

Issue tags: +Needs committer feedback

Hrm. WCAG violation for sighted users... If you'd ask me (but I'm not familiar with all of this), then I'd say a visual improvement for sighted users can happily wait for D8. The only definite bug I see is that non-sighted users have no effin' clue why a unpublished post still appears, because they don't see that background color at all. So, if it was me, I'd limit this bugfix for D7 to the hard accessibility bug for non-sighted users, especially as there is no valid and working solution for a visible "unpublished" text yet, so I'd leave that visible part to contrib for now (which can be easily done, given the theme function we're about to implement here).

However, that's just me, and so we need to ask Dries/webchick for their perspective. Until they follow-up, we can and should already work on the first part.

Everett Zufelt’s picture

Being a screen-reader user I know if a node or comment is unpublished (unapproved) because I have an option to approve / publish. Would anyone without the ability to publish / approve see an unpublished / unapproved entity?

As for colour, as long as it is perceivable, it is the same WTF for everyone about what the colour means, and again, can they not see the ability to pub / approve?

jacine’s picture

#8-2 with the fonts, the blocks module defines a font-family too modules/block/block.css: font-family: "Lucida Grande", Verdana, sans-serif;

This is wrong. It should never happen. It's unfortunate and disappointing that these styles keep making it into core CSS files. block.css is an atrocity, but unfortunately it's D8 material: #865084: Clean up block module css styles.

#8-3 I think it would work fine with a black background. It certainly would be more visible than the existing pink background for anything other than the same gray used with the text.. For most backgrounds it would be much more visible than what is there now.

#8-5 I wonder if the font size could be smaller for the comments too. We should have translations for unpublished in many different languages. I wonder if there is a way to simply compile all of the known translations for string length.

I don't want to see any background color, color, or font-size changes. Every single piece of code that messes with CSS in this way, ends up as another inconsistency and annoyance for a theme developer writing a custom theme. It's up to each theme to decide how this should fit into their design.

I'm not just objecting to the CSS though. I don't like how this is placed in the template file. I find it over designed for core, intrusive and IMO it's misplaced as it really only makes sense for this specific of design. If this text is properly placed, there will be no need to provide CSS for it. I'd much prefer a variable in the templates containing something like: <span class="status">This [entity] is [status].</span> or something, right underneath the title. I also agree that it should be generated by a theme function as opposed to spreading similar code across multiple template files, as there are more than a few places where this makes sense.

  • This node is unpublished.
  • This comment is unpublished.
  • This comment is marked as spam.
  • This user is blocked, etc...

#9 this would also be a problem with #394736: Unpublished node's pink background unclear then I assume.

Yes.

Bottom line is that it's not just an WCAG issue. I think it's clearly D8 material, but if for whatever reason an exception is made, it should be done right.

bowersox’s picture

sub

mgifford’s picture

Status: Needs work » Needs review

#3: comments-unpublished.patch queued for re-testing.

mgifford’s picture

Looks like the best we can do here is the suggestion from @sun in #13 for D7.

With that we can add the css in a theme or the accessibility helper module easily enough.

Can someone roll up a patch so we can try to get this into core?

No CSS, just the invisible text

mgifford’s picture

also, this post has been favoured from #394736: Unpublished node's pink background unclear which is now marked as a duplicate.

All the text from from http://drupal.org/files/issues/node-unpublished-394736.patch will need to be brought over and marked with element-invisible's class.

Not hard, but...

mgifford’s picture

StatusFileSize
new4.4 KB

Ok, this improves things for screen readers at the very least. Hopefully this can get into core & address unpublished nodes & comments.

I don't think there are any i18n considerations as the terms are very generic and must be used elsewhere.

Everett Zufelt’s picture

Still waiting on an answer to #19. The best method for solving this issue would seem to require us to:

1. Assess where we are.
2. Decide where we want to be.
3. Determine the best path between 1 and 2.

:)

Jeff Burnz’s picture

Its very hard to assess where we are Everett, your reports while interesting do not reflect a wider community. You are making an inference that a node or comment has a particular status, but its not stated, I think that is quite brittle, to rely of the appearance and detection of a link - in your own words you demand additional cognitive cycles - you make me think about this, rather than it simply being stated as such - this node is unpublished.

Was there some earth shattering reason why we can't have <?php print $unpublished; ?>, & push the logic back to template_preprocess_node etc, its not an API change, technically its an addition. Our templates are already clogged to the brim with confusing crap, really rather not have to do that in tpl.

Everett Zufelt’s picture

@Jeff

I am really not being argumentative here. I am attempting to gather information, about something that I am admittedly ignorant about, so that I can participate in a discussion about the best solution to the problem.

mgifford’s picture

@Everett - I Angie's point with the cat is better, but I've tried to lay out as much detail as I can here:
#928776-20: Unpublished comments have a styling issue

Please either apply the patch or check out my sandbox. Sorry you need to request another account.

@Jeff - <?php print $unpublished; ?> sounds good to me. Do you have time to roll up another patch. If not I can try to review it tomorrow.

Everett Zufelt’s picture

After getting some more information about this problem let me summarize my thoughts.

Problem

Entities do not explicitly display their status textually. Nodes only implicitly display their status textually if the node is in Edit mode.

Severity

Not critical since this existed in D6, but certainly important as this would improve usability and accessibility.

Solution

I like @Sun's suggestion in #13, with the exception of thinking that the textual representation should be visible to all by default, I am however flexible on this as long as it is easy for a themer to override the visibility of the text. Sun's approach is in accordance with good clean markup and easy to understand template files.

Challenges

#13 would mean that an API change needs to occur (perhaps this is only an API addition, I am not familiar enough to know for sure). Would #13 be able to go into D7, or would it have to wait for D8? Can we get Dries / Webchick's input on this possible solution without a patch to review, or would we need to roll a patch for #13 to get a review?

I would like to see a solution to this problem in D7, but if there is no clean solution that we can get into D7 I would be content with waiting to fix this problem once, and properly, in D8.

jacine’s picture

Thank you Everett. I'm happy to see an accurate assessment of the problem and acknowledgement of feedback that @sun and I gave in previous comments. As I mentioned, I'm on board with the solution as described in #13. I think the text should be visible though, or we are not solving anything here, other than making the text available to screen reader users. The reason this issue was opened in the first place is that the pink background is not a sufficient indication for an unpublished status and I think we all agree on that.

The patch in #25 does not take into account that this should be in a theme function, nor is it even consistent across the template files. Just moving the "crap" to preprocess functions it not acceptable either. Littering in preprocess functions is almost as bad files. This sort of thing is the definition of a use case for a theme function, so anything else is just a hack.

As Jeff points out in #27 it should just be printed as <?php print $unpublished; ?> in templates. No logic. This variable should generated in preprocess functions and print the status or and empty string. Also, is it really necessary to add all this markup?

<?php if (!$status && !isset($preview)): ?>
  <h2 class="element-invisible"><?php print t('Status'); ?></h2>
  <div class="element-invisible"><?php print t('Unpublished'); ?></div>
<?php endif; ?>

I don't think so...

Come to think of it, we already have a theme function theme_mark(), which exists for this sole purpose and is already styled (colored red) by default. I don't understand why we are not using it in more places, like in the comment.tpl.php file to indicate a new comment. It would be a good fit for the core solution IMO. Sure, it needs to be improved, and it's probably out of scope for D8, but so are a lot of other, equally important issues.

It's very important that we do not undo the work that was done to improve consistency and to clean up template files. I'd also like to point out that themes have access to the status of each of these entities and can easily implement a solution, in case that's not clear. We should not just throw markup at template files and call it a fix or an improvement, as tempting as it may be and especially, not at this stage. If we are going to fix this, we need to do it right, or do it in Drupal 8.

Jeff Burnz’s picture

OK, how about we pursue the theme_mark idea and go for a maintainer review to see where we're at for D7, I too would live with it being shunted to D8 for a proper fix.

mgifford’s picture

@Jacine I don't know if the the H2 line is added.

It would be really nice if we could get the output of #25 into core. Even if it only improves the situation for screen readers, it doesn't add to translation issues. I've worked on bringing this into the templates so it has less impact for themers by adding this to the template.php file in Bartik:

/**
 * Override or insert variables into the node template.
 */
function bartik_process_node(&$variables) {
  $variables['unpublished'] = (!$variables['status'] && !isset($variables['preview'])) ? '<div class="element-invisible">' . t('Unpublished') . '</div>' : '';
}

/**
 * Override or insert variables into the comment template.
 */
function bartik_preprocess_comment(&$variables) {
  $variables['unpublished-comment'] = ($variables['status'] == 'comment-element-invisible') ? '<div class="element-invisible">' . t('Unpublished') . '</div>' : $variables['status'];
}

and the line Jeff suggested to the comment.tpl.php & node.tpl.php files:

  <?php print $unpublished; ?>

I'm missing something for the comments though so that it isn't working.

I'd like to get this set up in a way that is visible, but @sun's said no additional css on this issue & there may be concerns about design changes.

It could be that we have to wait for D8 for this, but if we bring it in for screen readers there will be a precedent for D8 so that this can be addressed better for everyone.

Jeff Burnz’s picture

I'm a little perplexed why we want to hide this - that seems like a design decision best left to the themer.

mgifford’s picture

The only reason to make the text invisible as far as I am concerned is to make it possible to get into D7. Otherwise I'm all for going the route that Zen has or some similar way to theme it up.

If we can get a design decision in for D7 I'd be very happy!

cliff’s picture

Treading here gently, because I read through the issue queue quickly and am still a little foggy in the head from some dental work this afternoon. But:

  1. As Jeff has suggested in #34, this is an accessibility issue. With only a faint color and an "Approve" link to indicate that an item has yet to be published, people with cognitive disabilities — WCAG and all the laws based on it cover them, too — would not easily recognize which items are not yet published.
  2. The watermark-type fix depicted in #3 would not work for people with reading disabilities or moderate low vision. Heck, I can hardly read it, and I don't consider my vision to be impaired.
  3. As Jacine noted in #20, the best way to resolve these accessibility issues would also resolve accessibility issues for people who use screen readers: Add a simple, clear statement of the status of the item right after the item's heading.

So it seems to me that we need a patch that creates content — a clear statement of the item's status, just like the models Jacine gave in #20 — and leaves it to the theme in use to style that content appropriately.

Too much for D7, even in a point release? Then let's work it into D8. But that is certainly not my call to make.

jacine’s picture

Status: Needs review » Needs work
mgifford’s picture

Ok, so if we take the core themes and just add add:

  <?php print $entity_status; ?>

to the comment.tpl.php & page.tpl.php files. If the output from that is:

 <span class="element-invisible">This [entity] is [status].</span>

So the output is invisible by default and does not change any of the visual look/feel of the site (and heck for books in publication changing this would be a pain). This would made it possible for screen readers to know that a node/comment is unpublished. It has no significant changes to anyone else that I can see.

All the logic would go into the template.php files. I really think that this should go in core for D7. Even in a point release.

We need to work on this for D8 so that it is visible & properly themable. However, I think we can leave that for D8.

sun’s picture

It was already mentioned earlier that the markup contained in the template variable has to be generated by a generic theme function. Using the theme function, site builders and themers can tweak the output in whatever way to their likings. For D7, the default theme output uses .element-invisible.

However, I have the impression that there is some sort of disagreement about the usefulness of this textual status representation? Would be great to see an unbiased summary of the discussion.

bowersox’s picture

It seems that we are in general agreement that for D7 we should leave the visual display as-is and add invisible text to improve accessibility. This was first suggested by @sun in #13 and this idea seems to be a consensus. For D8 we can return to the idea of using visual wording in addition to the pink background (or instead of the pink background).

Everett Zufelt’s picture

@Sun

I think that there is agreement on the usefulness of the text, if anyone implied that it was not useful it may have been me. I do think the text is useful, I was trying to assess how severe of a problem there currently is, since I haven't had any problems myself.

As I understand it the following is required.

1. Enhance theme_mark() to allow for new mark types.

2. Possibly enhance theme_mark to provide the ability to pass 'classes' as a key in $variables, this is so that element-invisible can be passed, not to add any new CSS to Core. I prefer the mark not be invisible, but am content either way.

3. Provide a $unpublished variable in preprocess functions (which will get its value from theme_mark).

4. Add print $unpublished; to entity template files.

Other than that this may be (likely is) out of scope for D7, does anyone wish to correct or object to the above?

mgifford’s picture

Ok, so for the #1, are we looking for something like:

<?php
function theme_mark($variables) {
  $type = $variables['type'];
  global $user;
  if ($user->uid) {
    if ($type == MARK_NEW) {
      return ' <span class="marker">' . t('new') . '</span>';
    }
    elseif ($type == MARK_UPDATED) {
      return ' <span class="marker">' . t('updated') . '</span>';
    }
    elseif ($type == MARK_UNPUBLISHED) {
      return ' <span class="element-invisible">' . t('unpublished') . '</span>';
    }
  }
}
?>

As far as passing CSS through, I suppose one could just extend the array that's passed through by adding:
$class = $variables['class'];

Having the default for new & updated to be marker & the class for unpublished to be element-invisible.

What else can we document before someone wraps up a patch?

sun’s picture

Version: 7.x-dev » 8.x-dev

3 days before RC, this is going to be D8 material.

mgifford’s picture

Ok, this issue has been cold for a while. How are we going to ensure that we do a better job in Drupal 8? Unpublished content really shouldn't just be a very pale pink. Can we set a better default? I do think Zen set a good example here. Are there others that have been used in D7 themes we should be considering?

bowersox’s picture

It seems like Everett's summary in comment #41 is the best summary of a plan for moving ahead.

If anyone objects to that consensus, please speak up.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.11 KB

Ok, this needs to be cleaned up and tested for the bot, but wanted to put up a more recent patch with /core/ to get us moving with Everett's suggestion above.

Status: Needs review » Needs work

The last submitted patch, comment-node-unpublished-867830-46.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.11 KB

Oops.

Status: Needs review » Needs work

The last submitted patch, comment-node-unpublished-867830-48.patch, failed testing.

mgifford’s picture

Issue tags: +Needs tests

Looks like this needs some work on the unit testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.08 KB

Rerolled.

With the implementation of a draft state in Drupal 8 this will be even more important to clarify.

Status: Needs review » Needs work
Issue tags: -Usability, -Needs tests, -Accessibility, -Needs committer feedback, -Needs accessibility review

The last submitted patch, comment-node-unpublished-867830-51.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Usability, +Needs tests, +Accessibility, +Needs committer feedback, +Needs accessibility review

The last submitted patch, comment-node-unpublished-867830-51.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.19 KB

re-roll with attempt to fix notices.

mgifford’s picture

Oaryx’s picture

Status: Needs review » Needs work

Fatal error: Call to undefined function bartik_theme_mark() in /home/s071daa1dd4b1f22/www/core/themes/bartik/template.php on line 82

Failed on simplytest.me when switching to unpublished content.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.17 KB

Not sure how I missed this, but I wasn't respecting theme_mark().

This should resolve that error. Thanks for reporting it Oaryx.

Pete B’s picture

StatusFileSize
new3.22 KB

Fixed the comment to give the correct constant name
Refactored theme_mark to add a drupal_clean_css_identifier for sanity, and so we don't have so many identical spans
Improved bartik_preprocess_node and bartik_preprocess_comment to use the MARK_UNPUBLISHED constant

Thanks,
Pete

Status: Needs review » Needs work
Issue tags: -Usability, -Needs tests, -Accessibility, -Needs committer feedback, -Needs accessibility review

The last submitted patch, comments-node-unpublished-867830-59.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
Issue tags: +Usability, +Needs tests, +Accessibility, +Needs committer feedback, +Needs accessibility review
mgifford’s picture

I hadn't run into this function before:
http://api.drupal.org/api/drupal/core!includes!common.inc/function/drupa...

Like your re-factoring of theme_mark(). I do hope that the bot was just buggy as it looks good.

Just got this error on creating a new page though:
Fatal error: Call to undefined function bartik_mark() in /home/s1c6ed7f5a1c61ca/www/core/themes/bartik/template.php on line 82

Status: Needs review » Needs work

The last submitted patch, comments-node-unpublished-867830-59.patch, failed testing.

Pete B’s picture

StatusFileSize
new3.47 KB

I'm pretty sure that test fail in HistoryTimestampTest can't be related to this. Rerolling to fix the issue #62.

Pete B’s picture

Status: Needs work » Needs review

Setting needs review.

Status: Needs review » Needs work

The last submitted patch, comments-node-unpublished-867830-64.patch, failed testing.

Pete B’s picture

Status: Needs work » Needs review
StatusFileSize
new3.47 KB

Oh dear, I see the problem here...

mgifford’s picture

StatusFileSize
new122.98 KB

This shouldn't be like this:
+ <?php print (isset($unpublished)) ? $unpublished : 'fiwehgewiuf'; ?>

I also couldn't see any text associated with the unpublished comment.
Marker4UnpublishedNode.png

Something was lost between #51 & #55.

micnap’s picture

StatusFileSize
new3.42 KB

Here's the same patch with a few corrections.

mgifford’s picture

StatusFileSize
new20.45 KB

Unpublished is under the Comments. This needs to be changed in CSS.
Screen Shot 2013-03-22 at 8.05.37 AM.png

micnap’s picture

@mgifford - where should unpublished show for each comment?

mgifford’s picture

Issue tags: +d8ux, +#d8ux

Good question.. I think in this case it might make sense to just float right. It shouldn't overlap other text or lines and should be within the pink.

I added some more usability tags and hope to get some feedback from Bojhan.

Bojhan’s picture

This probally needs a bit of design, I dont think we should randomly float this - this is part of Bartik. Can I see all the cases this shows up and I will design how it should intertwine.

mgifford’s picture

Thanks Bojhan!

mgifford’s picture

Issue tags: -Usability, -Needs tests, -Accessibility, -Needs committer feedback, -Needs accessibility review, -d8ux, -#d8ux

Status: Needs review » Needs work
Issue tags: +Usability, +Needs tests, +Accessibility, +Needs committer feedback, +Needs accessibility review, +d8ux, +#d8ux

The last submitted patch, comments-node-unpublished-867830-69.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.42 KB

Reroll as the filename changed to bartik.theme

mgifford’s picture

Issue tags: -Usability, -Needs tests, -Accessibility, -Needs committer feedback, -Needs accessibility review, -d8ux, -#d8ux

Status: Needs review » Needs work
Issue tags: +Usability, +Needs tests, +Accessibility, +Needs committer feedback, +Needs accessibility review, +d8ux, +#d8ux

The last submitted patch, comments-node-unpublished-867830-77.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.41 KB

There where whitespace errors in the last patch.

There were 2 failing tests in Drupal\custom_block\Tests\CustomBlockTranslationUITest but those are probably un-related. I hope..

shanly’s picture

Status: Needs review » Needs work
Issue tags: +Usability, +Needs tests, +Accessibility, +Needs committer feedback, +Needs accessibility review, +d8ux, +#d8ux

The last submitted patch, comments-node-unpublished-867830-77-nowhitespace-errors.patch, failed testing.

mgifford’s picture

This is all likely going to need to be re-written in Twig. I still don't know where the best docs are to guide the transition over from phpTemplate.

mgifford’s picture

Think this addresses the twig changes.

mgifford’s picture

Status: Needs work » Needs review

Go bot.

Status: Needs review » Needs work

The last submitted patch, comments-node-unpublished-867830-84.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.38 KB
mgifford’s picture

StatusFileSize
new3.38 KB

Status: Needs review » Needs work
Issue tags: -Usability, -Needs tests, -Accessibility, -Needs committer feedback, -Needs accessibility review, -d8ux, -#d8ux

The last submitted patch, comments-node-unpublished-867830-87.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Usability, +Needs tests, +Accessibility, +Needs committer feedback, +Needs accessibility review, +d8ux, +#d8ux

The last submitted patch, comments-node-unpublished-867830-87.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new3.4 KB

re-roll

Status: Needs review » Needs work
Issue tags: -Usability, -Needs tests, -Accessibility, -Needs committer feedback, -Needs accessibility review, -d8ux, -#d8ux

The last submitted patch, comments-node-unpublished-867830-92.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Usability, +Needs tests, +Accessibility, +Needs committer feedback, +Needs accessibility review, +d8ux, +#d8ux

The last submitted patch, comments-node-unpublished-867830-92.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new2.92 KB

Reroll...

Status: Needs review » Needs work
Issue tags: -Usability, -Needs tests, -Accessibility, -Needs committer feedback, -Needs accessibility review, -d8ux, -#d8ux

The last submitted patch, comments-node-unpublished-867830-96.patch, failed testing.

BarisW’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, comments-node-unpublished-867830-96.patch, failed testing.

BarisW’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, comments-node-unpublished-867830-96.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

editing

mgifford’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new2.92 KB

Reroll.

Status: Needs review » Needs work

The last submitted patch, 103: comments-node-unpublished-867830-103.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 103: comments-node-unpublished-867830-103.patch, failed testing.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new2.96 KB

reroll

Status: Needs review » Needs work

The last submitted patch, 107: comments-node-unpublished-867830-107.patch, failed testing.

mgifford’s picture

Issue tags: +Needs reroll

What happened to return ' <span class="marker">' . t('updated') . '</span>';?

The patch needs a re-roll as theme.inc has changed.

mgifford’s picture

Title: "unpublished" status of rendered entities is not accessible » "unpublished" status of rendered entities is not accessible (and looks bad)
StatusFileSize
new35.68 KB

This needs to be refactored as the pink is just looking bad on the text it's sitting on too.
unpublished

EDIT: Note, this is a screenshot of the unpublished node, not also the unpublished comment.

mgifford’s picture

Issue tags: +TwinCities
pcorbett’s picture

Assigned: joshk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.98 KB

This is a re-roll but I haven't addressed changing the "bad" aspect of aesthetic.

Status: Needs review » Needs work

The last submitted patch, 112: comments-node-unpublished-867830-112.patch, failed testing.

mgifford’s picture

Issue tags: -TwinCities +TCDrupal 2014

This really is something we should fix in D8.. It just looks bad..

mgifford’s picture

Fatal error: Call to undefined function theme() in /core/themes/bartik/bartik.theme on line 140
$variables['unpublished'] = theme('mark', (array('type' => MARK_UNPUBLISHED)));

That's probably what's causing the failures... That only popped up when adding an article.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new2.98 KB

Let's try this using _theme() instead.

mgifford’s picture

StatusFileSize
new2.98 KB

missed a theme()...

Edit: That works now in http://s53abb3f3182618d.s2.simplytest.me/

mgifford’s picture

StatusFileSize
new55.07 KB

Unpublishing a comment looses it's state.

We really need to be able to unpublish comments....

EDIT: This is a problem in core that is unrelated to this patch.

mgifford’s picture

Wanted to add the styling back in as per the "bad" aesthetic...

The last submitted patch, 116: comments-node-unpublished-867830-116.patch, failed testing.

mgifford’s picture

Status: Needs review » Needs work

#119 Got the CSS wrong.. It's probably in nearly the right place, but the patch clearly needs work.

sutharsan’s picture

Issue tags: -Needs reroll
mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new4.26 KB

Old patch needed a reroll. Still needs styling..

mgifford’s picture

Well, there's styling to the node now, but it's the wrong comment.

Plus need to style the comments.

Node unpublished screenshot.

mgifford’s picture

I think the "Mark content" functionality is broken.

It doesn't seem to be used at all for comments from what I could tell.

With nodes it's not clear how to set it. the only place I could see it being set was drupal_common_theme() and with MARK_NEW. Not sure how to get it to be another mark logically.

Is this better documented somewhere?

Status: Needs review » Needs work

The last submitted patch, 125: comments-node-unpublished-with-style-867830-125.patch, failed testing.

mgifford’s picture

Issue tags: -TCDrupal 2014 +dcamsa11y
xjm’s picture

Issue summary: View changes
Issue tags: -Needs committer feedback +Needs issue summary update

This was tagged for committer feedback back in 2010 as to whether it could be allowed in D7, so I'm going to remove this tag. ;) The issue could use an up-to-date summary, though. The approach in the patch with the constant seems off to me, and doesn't seem to have anything to do with fixing a WCAG violation. I've added a beta evaluation as best I understand it, but please correct and add up-to-date details to the summary.

xjm’s picture

Issue summary: View changes
mgifford’s picture

Issue summary: View changes
davidhernandez’s picture

Issue tags: +Needs reroll
+++ b/core/includes/theme.inc
@@ -1428,6 +1433,29 @@ function template_preprocess_tablesort_indicator(&$variables) {
+print_r($type);
+exit();

Pretty sure that shouldn't be there.

Adding needs reroll, because I assume after 2 months it's gunna to need it. Lets get this finished.

manuel garcia’s picture

Assigned: Unassigned » manuel garcia

Rerolling #125

manuel garcia’s picture

Assigned: manuel garcia » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.63 KB

On #125:

  1. +++ b/core/includes/theme.inc
    @@ -1428,6 +1433,29 @@ function template_preprocess_tablesort_indicator(&$variables) {
    +print_r($type);
    +exit();
    

    Omitted in the reroll

  2. +++ b/core/modules/node/node.module
    @@ -251,6 +251,9 @@ function node_mark($nid, $timestamp) {
    +  // if (!$node->isPublished()) {
    +    return MARK_UNPUBLISHED;
    +  // }
    

    $node is not available here, so this chunk we will have to figure out I suppose.

    I have left it there, commented as in the previous patch.

  3. +++ b/core/themes/bartik/css/style.css
    @@ -839,8 +839,8 @@ ul.links {
    -  margin: -20px -15px 0;
    -  padding: 20px 15px 0;
    +  margin: -10px 0 0;
    +  padding: 15px 0 0;
     }
    

    Core had changed the padding here, and had removed the margin.

    I have changed that to have our styles, we can figure out if we broke something later on.

Attached the reroll.

Status: Needs review » Needs work

The last submitted patch, 133: comments-node-unpublished-with-style-867830-132.patch, failed testing.

manuel garcia’s picture

Issue tags: -Needs reroll
mgifford’s picture

1. Thanks. Sorry that got left in there.

2. So if we don't have access in node_mark() can we bring this into mark.html.twig - certainly the docs in that template should be changed to include references to MARK_UNPUBLISHED

3. I was going to capture a screenshot, but hit "Fatal error: Call to undefined function _theme()". Looks like _theme() got removed. Not sure what to replace it with.

akalata’s picture

akalata’s picture

At some point since #1939092: Convert theme_mark() to Twig, theme_mark() was returned (it had been removed). I'm thinking we need a new issue to bring back the marker, then continue with this issue that's focused on the styling?

I've attached a reroll that also attempts to address 2 and 3 from #136. Fixed the WSOD, but doesn't make the marker show up.

Also, is the "unpublished" marker something that should be in core, or just in Bartik?

akalata’s picture

Status: Needs work » Needs review
mgifford’s picture

Issue summary: View changes
StatusFileSize
new103.79 KB

This is a screenshot of unpublished node & comment
screenshot of unpublished node & comment

The 1st comment is unpublished the 2nd is published. There's no difference if the node is unpublished. Probably not all that important.

Thanks for letting me know what did happen to theme_mark(). Setting up a new issue to add back in the marker would probably make sense. So postpone this one until that one is fixed....

It's important to have the semantic information available to let screen readers know that something is published or unpublished. Right now there is no way to indicate this.

I do think this should be a pattern in Core for all themes & not just Bartik & Seven. We want the default unpublished text to contain information in it which improves accessibility & usability. Being able to clearly know what nodes are unpublished will help with this.

mgifford’s picture

Issue tags: +Needs reroll

Patch no longer applies.

Status: Needs review » Needs work

The last submitted patch, 138: comments-node-unpublished-with-style-867830-138.patch, failed testing.

timmillwood’s picture

Issue tags: +Novice
manuel garcia’s picture

Issue tags: +Bartik
manuel garcia’s picture

Assigned: Unassigned » manuel garcia

Rerolling...

manuel garcia’s picture

Assigned: manuel garcia » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new7.13 KB

Rerolled.
Comments on the conflicts fixed:

  1. +++ b/core/modules/system/css/system.theme.css
    @@ -8,6 +8,30 @@
    +  box-shadow: 0 -8px 0 #d8d8d8;
    +  z-index: 0;
    +}
    +.node-preview div.unpublished {
    +  display: none;
    +}
    +.preview .comment div.unpublished {
    +  display: none;
    +}
    +.marker {
    +    color: #d8d8d8;
    +    font-family: Impact,"Arial Narrow",Helvetica,sans-serif;
    +    font-size: 75px;
    +    font-weight: bold;
    +    height: 0;
    +    line-height: 1;
    +    overflow: visible;
    +    text-transform: uppercase;
    +    word-wrap: break-word;
    +    float: right;
    +    position: relative;
    +    left: -50%;
    +    text-align: left;
    +    z-index: -1;
     }
    

    The file system.theme.css is now gone, placed these on /core/themes/bartik/css/components/node.css

    Someone from the Bartik team should take a look at this change.

  2. +++ b/core/modules/system/css/system.theme.css
    @@ -76,9 +100,6 @@ label.option {
    -.marker {
    -  color: #e00;
    -}
    

    This was moved onto core/modules/system/css/components/form.theme.css - removed from there now.

  3. +++ b/core/modules/system/templates/mark.html.twig
    @@ -18,5 +19,7 @@
    +  {% elseif status is constant('MARK_UNPUBLISHED') %}
    +    <span>{{ 'unpublished'|t }}</span>
    

    This file now contains no markup, so I added this without the span.

    Made the change as well inside core/themes/classy/templates/content/mark.html.twig with the span class="marker"

  4. +++ b/core/themes/bartik/templates/comment.html.twig
    @@ -74,6 +74,7 @@
    +    {{ unpublished }}
    

    This whole file's markup was redone, so ive added as what I see the equivalent place as it was before. We should probably do testing on this.

I've also added the changes we make to node and comment templates on the classy theme.

Status: Needs review » Needs work

The last submitted patch, 147: unpublished_status_of-867830-147.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new1.46 KB
new7.16 KB

Fixing several nits and hopefully the errors. Details in interdiff.

hussainweb’s picture

Please revert file mode changes on commit (or in the next patch). I am not sure why they happened.

manuel garcia’s picture

StatusFileSize
new7.09 KB
new437 bytes

Thanks @hussainweb for fixing the failing tests!

Restoring the file mode changes...

mgifford’s picture

Status: Needs review » Needs work
StatusFileSize
new34.47 KB
new9.47 KB

Glad to see progress here. Took a look at the patch. Now technically, the light grey/pink really don't have enough colour contrast, but they are really, really big http://leaverou.github.io/contrast-ratio/#%23FFF4F4-on-%23d8d8d8

Anyways, I don't think we can deal with that as we really want it to be a background to the main black text.

I attached to screenshots though of problems with the CSS.

When the screen is reduced, the text extends beyond the left hand margin of the text for the node body. It also gets cut off for the comment body. It's hard to tell but both the node & comment are unpublished here:

Also, if the body is published but the comment isn't the 'unpublished' text just doesn't show up:

I think the unpublished text needs to be re-sized based on the size of the body that contains it.

lewisnyman’s picture

Issue summary: View changes
StatusFileSize
new568.19 KB

Sorry to push this issue in another direction but I'm not feeling this new design either. How about we have something like this instead?

manuel garcia’s picture

@LewisNyman I like that idea better because you can see better how the node will look like after you publish it.

mgifford’s picture

That looks way better. I've got no problem with that approach. We'd need to make sure it was accessible in its implementation, but something like that would be as visible as what we have now (if not more so).

davidhernandez’s picture

Yeah, I'd much rather have a label than the background. I've always disliked the background because the interference with the node's display.

emma.maria’s picture

I like the label concept. I think its a nice improvement and gets rid of the pink background :-)

yoroy’s picture

Nice one! This makes a lot of sense. Color choice in line with the style guide as well :-)

Bojhan’s picture

Issue tags: -Needs usability review

This would also be my prefered way of doing it, the only challenge is that no one ever themes this stuff. So it needs to look really good by default and/or we should show a very nice looking practice in Bartik

lewisnyman’s picture

Yeah this styling should go into Classy, like with the messages.

emma.maria’s picture

Issue tags: +Classy
mgifford’s picture

@Bojhan It would be great if it looked really good by default. However, I'd settle for it looking better than what we have now & being accessible.

@LewisNyman are you going to write up a patch for review? Maybe this can be fixed up quickly now that we've got a critical mass of folks who seem to like this approach.

lewisnyman’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new8.51 KB
new509.32 KB

I went quite far with this patch. I seemed quite difficult to add this to the title and all the unpublished logic is in the node.html.twig file. I realised that we had to solve the same problem. for comments, so I created a reusable component that could be used in other situations going forward. It has similar success/warning/error options that messages does. This could probably get turned into a theme component in 8.1.

Status: Needs review » Needs work

The last submitted patch, 163: unpublished_status_of-867830-163.patch, failed testing.

googletorp’s picture

Status: Needs work » Needs review
StatusFileSize
new8.38 KB
new517 bytes

Clean up comments for the new CSS, so they are consistent with the other component CSS files.

Status: Needs review » Needs work

The last submitted patch, 165: 867830-164.patch, failed testing.

The last submitted patch, 163: unpublished_status_of-867830-163.patch, failed testing.

The last submitted patch, 165: 867830-164.patch, failed testing.

rainbowarray’s picture

#2476947: Convert "title" page element into a block in theory could help with this if you want unpublished after the titled, as it could allow the unpublished badge to be added to title_suffix with a preprocess_page_title as Shortcut module will do if that goes in.

lewisnyman’s picture

Clean up comments for the new CSS, so they are consistent with the other component CSS files.

@googletorp Do you think that the information before was more useful than the information your replaced it with?

markhalliwell’s picture

no one ever themes this stuff

No one's ever really "themed" it because there wasn't really anything to theme before. It was just a class that allowed you to change very little about the div in question. This is technically replacing this existing implementation with a whole new, and entirely separate, element to be themed. I know for a fact that people do theme the new/updated labels found elsewhere through out the site (e.g. admin content view, comments).

No, what this issue should now be proposing is to add a new "mark" type (node_mark() and mark.html.twig), not introducing a whole new (and separate) "status label" element.

Subsequently, this is now a feature request and no longer a bug. Especially considering that this is now adding new elements and removing old ones (which is technically a BC break btw, someone may actually be using this class and introducing their own :before pseudo element).

Color choice in line with the style guide as well :-)

So we're using Seven's style guide for Bartik now? I understand that Bartik doesn't actually have a style guide, but this somehow seems like a very wrong direction to be heading towards.

I agree with adding a label for this information, however not so much with the color choice. It looks rather out of place. I would prefer that we keep this in the red hue range.

yoroy’s picture

I was under the impression that this was a generic solution. Since the checkbox for 'edit content in the admin theme' is on by default in standard profile it seems a good default to base this off of Seven. Wouldn't hurt to pick a better color for Bartik indeed.

I don't see how a different kind of solution turns the initial problem from bug into feature request though.

lewisnyman’s picture

Subsequently, this is now a feature request and no longer a bug. Especially considering that this is now adding new elements and removing old ones (which is technically a BC break btw, someone may actually be using this class and introducing their own :before pseudo element).

We are fixing a bug by designing a solution that is reusable. I don't consider this a feature request. This is the right way to solve these kinds of problems. Also, we can break markup BC before Release Candidate 1.

No, what this issue should now be proposing is to add a new "mark" type (node_mark() and mark.html.twig), not introducing a whole new (and separate) "status label" element.

Ah nice, it would be great to make this a simple template that we can apply the classes to. Could you help with this? We still have time before RC.

So we're using Seven's style guide for Bartik now? I understand that Bartik doesn't actually have a style guide, but this somehow seems like a very wrong direction to be heading towards.

We use the Seven style guide colors for messages, the Seven style guide is the closest we have to a color scheme, if Bartik wants to override the defaults then we could do that. It doesn't at the moment though.

I agree with adding a label for this information, however not so much with the color choice. It looks rather out of place. I would prefer that we keep this in the red hue range.

Red means "error". I imagine a workflow state like "needs work" would use this status. Unpublished seems more important that just "information" but less important than "something is wrong".

googletorp’s picture

@LewisNyman I figured that we want consistency in core and comments that abide the coding standards, both got fixed with the patch I made.

emma.maria’s picture

@googletorp:
Admin components are a lot more complex than components in a standard visual theme and may need more description. I think the comment change in #165 gives the user less detailed information, which is not what the coding standards suggest.

Well commented code is extremely important. Take time to describe components, how they work, their limitations, and the way they are constructed. Don't leave others guessing as to the purpose of uncommon or non-obvious code.

— https://www.drupal.org/node/1887862#comments

+++ b/core/themes/classy/css/components/status-label.css
@@ -1,9 +1,6 @@
 /**
  * @file
- * Status labels can be used to signify the status of system entities.
- * eg. Unpublished nodes or comments.
- * @see node.html.twig.
- * @see comment.html.twig.
+ * Visual styles for status labels.
  */
googletorp’s picture

@emma.maria Coding standards dictate that the file doc should be

• 1 line explaining the the file is about
• optionally a blank line and a more detailed description

The initial line is too long and doesn't explain what is in this file and there is no blank line.

Status labels can be used to signify the status of system entities. eg. Unpublished nodes or comments.

The comment explains what a status label is, it should be explaining what the file is used for (visual styles for status labels).

Also I would like to argue that we shouldn't document what a component is, in a CSS file, since that doesn't have anything to do with what the component is, only how it should appear on the screen. This documentation should be in the node module or wherever we define this.

The reference to the files could be ok, but I opted out of this, since it's not done anywhere else.

googletorp’s picture

Anyways the file comment is a small thing, I believe it's more important to actually solve the issue.

Lets gets a working patch first before discussing comments anymore, I would hate to take the focus away from the most important thing here. If you want to change the comment, then fine by me, but please fix grammar and the overall standards for comments (so machines like api.drupal.org can read the comments and expose them to users).

yoroy’s picture

yoroy’s picture

Ah, thanks :)

emma.maria’s picture

StatusFileSize
new8.68 KB

The patch needed a reroll.

emma.maria’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 181: unpublished_status_of-867830-181.patch, failed testing.

The last submitted patch, 181: unpublished_status_of-867830-181.patch, failed testing.

lewisnyman’s picture

I had a discussion with Maouna about #2290101: UI telling you a field is shared across languages is way too subtle and how we can share the same implementation. If we take @markcarver's recommendation and reuse mark.html.twig we are going to have to expand it considerably to accommodate more than just the node markers.

This is the code that they would expect to use in #2290101: UI telling you a field is shared across languages is way too subtle:

$suffix = array(
  '#theme' => 'mark',
  '#status' => 'shared',
   '#type' => 'warning'
);

The current mark.twig.html implementation looks like this:

{#
/**
 * @file
 * Theme override for a marker for new or updated content.
 *
 * Available variables:
 * - status: Number representing the marker status to display. Use the constants
 *   below for comparison:
 *   - MARK_NEW
 *   - MARK_UPDATED
 *   - MARK_READ
 */
#}
{% if logged_in %}
  {% if status is constant('MARK_NEW') %}
    <span class="marker">{{ 'new'|t }}</span>
  {% elseif status is constant('MARK_UPDATED') %}
    <span class="marker">{{ 'updated'|t }}</span>
  {% endif %}
{% endif %}

We'd have to open it up so you can pass any status in there, and also remove the logged in requirement, which seems like a weird layer to check for this anyway.

lewisnyman’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new16.05 KB
new18.46 KB
new489.11 KB

Here's a patch that completely rewrites the implementation of mark.html.twig. No big deal. Look at these lovely markers.

Status: Needs review » Needs work

The last submitted patch, 186: unpublished_status_of-867830-186.patch, failed testing.

lewisnyman’s picture

Status: Needs work » Needs review
StatusFileSize
new11.42 KB
new13.56 KB

Whoops. Somehow I missed that I had already applied a patch.

Status: Needs review » Needs work

The last submitted patch, 188: unpublished_status_of-867830-188.patch, failed testing.

The last submitted patch, 186: unpublished_status_of-867830-186.patch, failed testing.

The last submitted patch, 188: unpublished_status_of-867830-188.patch, failed testing.

nlisgo’s picture

Assigned: Unassigned » nlisgo

Me and @thewilkybarkid will be looking to address the failing tests! Wish us luck!

emma.maria’s picture

Good luck :)

nlisgo’s picture

I will be reviewing the code changes and @thewilkybarkid will be looking into some of the failing tests.

nlisgo’s picture

  1. +++ b/core/includes/theme.inc
    @@ -32,21 +32,6 @@
    -const MARK_NEW = 1;
    -
    -/**
    - * Mark content as being updated.
    - */
    -const MARK_UPDATED = 2;
    

    These constants are still referred to in mark.html.twig

  2. +++ b/core/themes/bartik/templates/node.html.twig
    @@ -36,7 +36,6 @@
      *     admins.
    

    'admins' also needs to be removed if you are getting rid of node--unpublished

nlisgo’s picture

Status: Needs work » Needs review
StatusFileSize
new628 bytes
new13.57 KB
+++ b/core/modules/comment/comment.module
@@ -736,9 +736,20 @@ function template_preprocess_comment(&$variables) {
+  if($variables['status']) {

This condition causes an exception to be thrown if $variables['status'] is undefined.

This patch address this.

thewilkybarkid’s picture

This updates 3 XPath queries to match the HTML changes. The tests should now all pass.

The last submitted patch, 196: unpublished_status_of-867830-196.patch, failed testing.

nlisgo’s picture

The feedback in #195 still needs to be addressed. I'm unclear what we need to do with mark.html.twig because it is completely redundant right now. Can someone who has an idea what we want the default markup to be take that on?

akalata’s picture

Assigned: nlisgo » Unassigned
mgifford’s picture

Issue summary: View changes
StatusFileSize
new22.94 KB
new102.86 KB
new121.32 KB

I don't have anything to add @nlisgo but looking for answers too.

We have to consider the comments too:
unpublished comments

Decided to add this screenshot from a mobile device.

It's looking good.

nlisgo’s picture

Addressing feedback in #195. Can someone verify that the markup in the default mark.html.twig file is as expected.

The last submitted patch, 196: unpublished_status_of-867830-196.patch, failed testing.

mgifford’s picture

The MARK_NEW, MARK_UPDATED, & MARK_READ were removed from what was theme_mark() in comment #186. This might need a broader discussion. I remember them coming in, but not sure where. There's an argument against removing them from #1311372-13: Use <mark> element for 'mark' theme hook but they aren't very flexible as @Jacine points out and I don't know who uses them.

I've got nothing against using <mark> but but we should be clear about introducing this.

EDIT: We also really need to test this in the forums with new, updated & read content.

lewisnyman’s picture

Sorry for overbaking the patch :P

mgifford’s picture

That's fine. I just want to make sure we're not introducing any regressions with this patch.

Bojhan’s picture

This probably shouldn't be using the mark tag, thats to be used for highlighting.

The design approach looks solid.

lewisnyman’s picture

I am happy to move <mark> into #1311372: Use <mark> element for 'mark' theme hook an then we don't have to have this discussion here.

yesct’s picture

Issue summary: View changes
Issue tags: +Needs screenshots

I put one of the after screenshots from #201 in the issue summary.

Recent before screenshots are also needed.

Probably also before and after markup would be useful to also put in the summary.

gábor hojtsy’s picture

Status: Needs review » Needs work

Let's move the mark tag there and then we can get this in ASAP. Highly interested given #2290101: UI telling you a field is shared across languages is way too subtle depends on this one. Also:

+++ b/core/modules/node/node.module
@@ -613,6 +613,17 @@ function template_preprocess_node(&$variables) {
+  if( !$variables['node']->isPublished() ) {

Spacing code style issues.

gábor hojtsy’s picture

Issue tags: -Needs screenshots
Maouna’s picture

Assigned: Unassigned » Maouna
Maouna’s picture

Assigned: Maouna » Unassigned
Status: Needs work » Needs review
StatusFileSize
new16.12 KB
new413 bytes

Fixed the spacing mentioned in #210.

lewisnyman’s picture

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

Setting to needs work to remove the mark HTML element from mark.html.twig. Let's keep using a span instead.

strykaizer’s picture

Status: Needs work » Needs review
StatusFileSize
new0 bytes
new4.07 KB

#213 with mark tag removed, and marker.css readded (seems to have been lost in the patches somewhere).

Status: Needs review » Needs work

The last submitted patch, 215: unpublished_status_of-867830-215.patch, failed testing.

strykaizer’s picture

Status: Needs work » Needs review
StatusFileSize
new16.66 KB
new4.04 KB

#213 with mark tag removed, and marker.css readded (seems to have been lost in the patches somewhere).

yesct’s picture

Issue summary: View changes
Issue tags: +blocker

updated issue summary, noting #2290101: UI telling you a field is shared across languages is way too subtle is postponed on this.

wim leers’s picture

  1. +++ b/core/includes/theme.inc
    @@ -34,21 +34,6 @@
    - * Mark content as read.
    - */
    -const MARK_READ = 0;
    -
    -/**
    - * Mark content as being new.
    - */
    -const MARK_NEW = 1;
    -
    -/**
    - * Mark content as being updated.
    - */
    -const MARK_UPDATED = 2;
    

    <3

  2. +++ b/core/modules/comment/comment.module
    @@ -716,9 +716,20 @@ function template_preprocess_comment(&$variables) {
    +  $variables['markers'] = drupal_render($markers);
    

    Why the early rendering? Let Twig do the rendering. So that the cacheability metadata and assets for this are not bubbled if it's not actually printed in the template.

  3. +++ b/core/modules/node/node.module
    @@ -613,6 +613,17 @@ function template_preprocess_node(&$variables) {
    +  $variables['markers'] = drupal_render($markers);
    

    Same.

  4. +++ b/core/modules/system/templates/mark.html.twig
    @@ -4,19 +4,12 @@
    + * - status: The status message to display.
    + * - type: The status message to display.
    

    This seems wrong.

  5. +++ b/core/themes/bartik/templates/node.html.twig
    @@ -89,6 +86,15 @@
    +          {{ attach_library('classy/marker') }}
    

    <3

  6. +++ b/core/themes/classy/templates/content/mark.html.twig
    @@ -4,17 +4,9 @@
    + * - status: The status message to display.
    + * - type: The status message to display.
    

    Wrong again.

  7. +++ b/core/themes/classy/templates/content/mark.html.twig
    @@ -4,17 +4,9 @@
    +{{ attach_library('classy/marker') }}
    

    <3

yesct’s picture

Issue summary: View changes
StatusFileSize
new184.89 KB

added before to the summary. there will probably be markup changes, when the patch is ... done.. we should get a new after screenshot and markup.

lewisnyman’s picture

Assigned: Unassigned » lewisnyman

Workin' on it

lewisnyman’s picture

Assigned: lewisnyman » Unassigned
StatusFileSize
new2.38 KB
new16.54 KB
lewisnyman’s picture

Here are screenshots in Classy and Bartik:



Status: Needs review » Needs work

The last submitted patch, 222: unpublished_status_of-867830-222.patch, failed testing.

The last submitted patch, 222: unpublished_status_of-867830-222.patch, failed testing.

yesct’s picture

needs an issue summary update, updating if it is allowed in rc. https://www.drupal.org/core/d8-allowed-changes

eiriksm’s picture

Status: Needs work » Needs review
StatusFileSize
new17.4 KB
new879 bytes

Just fixing the test failure in #222.

For the record. Interdiff in #222 seemed to address all concerns from #219

Status: Needs review » Needs work

The last submitted patch, 227: unpublished_status_of-867830-227.patch, failed testing.

eiriksm’s picture

Status: Needs work » Needs review
StatusFileSize
new18.07 KB
new967 bytes

...oops. A bit fast there.

_this_ should fix the tests :)

mgifford’s picture

@YesCT - the issue summary looks pretty solid at this point. I'd only add the final html output when the final patch is agreed to. I think we can remove the "Needs issue summary update" unless we get more guidance about what is needed.

mgifford’s picture

Issue summary: View changes
mgifford’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

I think this satisfies the "Needs issue summary update" tag.

mgifford’s picture

Issue summary: View changes

Commenting out Unfrozen & Prioritized changes which aren't part of RC.

mgifford’s picture

Issue summary: View changes
mgifford’s picture

Issue summary: View changes
mgifford’s picture

Status: Needs review » Reviewed & tested by the community

I think this has been tested sufficiently and will greatly enhance Drupal 8 while also fixing another blocked bug.

The last submitted patch, 227: unpublished_status_of-867830-227.patch, failed testing.

Bojhan’s picture

Version: 8.0.x-dev » 8.1.x-dev

This is changing markup, so sadly 8.1

mgifford’s picture

@Bojhan, any reason we can't bump this back to 8.0 and see if it can get in with "rc target triage"? This issue has been open for 5 years and it would be really nice to just use this implementation that we have now which looks way more professional. Especially since it unblocks another issue.

We'd need to add the <h3>Why this should be an RC target</h3> statement of course.

lewisnyman’s picture

Version: 8.1.x-dev » 8.0.x-dev
Issue tags: +rc target triage

Let's find out!

lewisnyman’s picture

Issue summary: View changes

I only found one good reason for committing this before release, which is accessibility.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 229: unpublished_status_of-867830-229.patch, failed testing.

Jeff Burnz’s picture

The accessibility improvements are well worth it and it looks way more professional, lets please allow this in.

rootwork’s picture

Given the number of outstanding accessibility improvements in Drupal 8 -- and given the minor CSS changes and lack of disruption this feature would cause -- I definitely think this is worth allowing in the RC phase.

I do think given the addition of the {{ markers }} variable in templates (and some people will have already started developing on earlier RCs and created their own templates) we should probably include a change record or some kind of notice. But that's a really minor addition given the number of improvements this brings.

rootwork’s picture

Status: Needs work » Needs review
StatusFileSize
new17.82 KB
new472 bytes
+++ b/core/themes/classy/classy.libraries.yml
@@ -25,6 +25,8 @@ base:
+      css/layout.css: {}

This was added somewhere along the way in this issue, but the file doesn't exist. Removing this to fix the failing test.

mgifford’s picture

Status: Needs review » Needs work

I think there's something weird with the Basic Page content type. Maybe there's just a glitch, but I can't seem to get the unpublished code to appear on that page. Works fine with articles & with new content types. Could someone else please verify if it is working for them or not.

EDIT: Wanted to add that without the patch, the light pink background still shows up just fine.

rootwork’s picture

Verified on SimplyTest that with the patch, neither the light pink background nor the new marker shows up on unpublished basic page drafts.

If I get a chance I'll try to dig into it, but if someone else wants to work on it please do.

xjm’s picture

We should consider the non-accessibility of the draft state labeling a bug for sure, but I'm not sure about the design changes during RC. Tagging for product manager review for that.

xjm’s picture

Could we start by adding the word "draft" more clearly, and split the design changes out for a minor version target? Maybe? Waiting to see what @webchick recommends.

webchick’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue tags: -rc target triage, -Needs product manager review

Yeah, personally I'd feel safer pushing this to 8.1.x vs. trying to get it in now, due to markup + string freeze (invalidates books, documentation, videos, etc. for a problem that already existed in D7). The design changes look reasonable to me, but I'd love longer than a couple of weeks (we hope) to let them sink in / do any necessary clean-ups. That said, this is a fantastic improvement and I'm really looking forward to it.

I don't understand though why #2290101: UI telling you a field is shared across languages is way too subtle is postponed on this? (that one feels more major than this one, since it's a new problem introduced in D8.)

gábor hojtsy’s picture

@webchick: well, that one is a 4 line patch that just uses the template / design / css introduced here :) So if we are to introduce it for that issue, then we need to move over a lof of what this issue proposes there :) not sure if postponing the very small that is left of this to 8.1 is good then?

andypost’s picture

Looking through discussion I wondered why nobody suggested a javascript approach for that.
Having a data-mark attribute can make the change a BC way and will allow contrib themes to easily extend and override implementation

  1. +++ b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
    @@ -81,7 +81,7 @@ public function render(ResultRow $values) {
    +    $mark = t('read');
    
    @@ -89,13 +89,13 @@ public function render(ResultRow $values) {
    +        $mark = t('new');
    ...
    +        $mark = t('updated');
    ...
    +        $mark = t('updated');
    

    I think this strings are too short so needs translation context

  2. +++ b/core/themes/classy/css/components/node.css
    @@ -3,6 +3,6 @@
    +.node__status {
    +  float: right;
    

    needs rtl support

gábor hojtsy’s picture

Would be amazing to get the outstanding feedback resolved and the patch landing in 8.1 sooner than later. We would love to build on it still in 8.1 with #2290101: UI telling you a field is shared across languages is way too subtle.

eiriksm’s picture

Status: Needs work » Needs review
StatusFileSize
new18.03 KB
new1.92 KB

Implemented suggestions in #252

mgifford’s picture

Status: Needs review » Reviewed & tested by the community

I think this is good to go. @andypost concerns 1 & 2 are addressed.

His comments haven't been addressed:

Looking through discussion I wondered why nobody suggested a javascript approach for that.
Having a data-mark attribute can make the change a BC way and will allow contrib themes to easily extend and override implementation

But I think those can probably be dealt with in a separate issue. I'd like to get this issue fixed and this is a much better solution than we have.

emma.maria’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new77.29 KB
new74.88 KB

I visually tested Bartik out and I'm not too happy with what it outputs in the UI.

When there is a "new" stamp and the unpublished marker they sit squashed together. Also the unpublished marker always sits flush to the border of the content info.

Also when one comment has a "new" and one doesn't they end up with different indentation. This can mislead comments to look like they are children of each other when they are meant to be at an equal level.

For a quick fix that makes it look much much better, can we please have the {{ marker }} printing within the ".comment__meta" markup wrapper within the template so it gets the same layout and spacing as the rest of the content below the marker?

See screenshots....

Before



After - within the wrapper.



yoroy’s picture

That makes a lot of sense, thanks @emma.maria

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new18.08 KB
new1.16 KB

Good call @emma.maria. Here it is.

yoroy’s picture

StatusFileSize
new81.7 KB

Latest patch does what #256 suggests. It's not so nice that the typography differs between node and comment. Looks like that bit is Bartik specific. In Seven the labels look identical on node and comment.

Status: Needs review » Needs work

The last submitted patch, 258: unpublished_status_of-867830-258.patch, failed testing.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

emma.maria’s picture

So I assume we need to remove the work that touches the Classy theme now because that is frozen until D9? Core and Bartik can still have this work though.

eiriksm’s picture

Hm, then I guess we have a problem.

This patch changes the "status" variable in the marker template to contain the status text. So if we were to leave classy alone, then it would try to compare strings to undefined constants (since this patch also removes the constants it is comparing to).

Not sure what the correct way of proceeding would be, if we can not touch classy before D9? The only other way would be to keep the constants, change the text to end up in another variable (like status_text). Keep setting the status variable to the correct constant, and use them both for BC?

star-szr’s picture

Yup using two variables seems like a sensible way forward. As much as I want to see this change everywhere we need to be very careful about changing Classy and Stable and this case may not be worth the disruption it will cause.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

mlncn’s picture

Would it be easier to get this done targeting Drupal 9 directly right now, quickly?

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

lolcode’s picture

Just found this issue and I'm looking forward to seeing it in core.
This would need to be tested in Olivero as well so I added the related issue.

lolcode’s picture

StatusFileSize
new18.21 KB

I have attempted to re-roll the patch. I did not attempt to address the previous test failure.

micnap’s picture

Issue summary: View changes
micnap’s picture

Issue summary: View changes
micnap’s picture

Issue summary: View changes
micnap’s picture

Issue summary: View changes

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

anmolgoyal74’s picture

StatusFileSize
new19.08 KB
new2.79 KB

Updated CS issues and classy theme file hash.

anmolgoyal74’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 281: unpublished_status_of-867830-281.patch, failed testing. View results

msuthars’s picture

Assigned: Unassigned » msuthars
msuthars’s picture

Assigned: msuthars » Unassigned

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

pameeela’s picture

Title: "unpublished" status of rendered entities is not accessible (and looks bad) » "Unpublished" style of rendered entities is not accessible (and looks bad)
Issue summary: View changes
xjm’s picture

Priority: Normal » Major

This is major due to the multiple related accessibility issues, including missing information for blind users and failing the contrast ratio.

Edit: This issue is honestly almost critical as it involves not one but two clear violations of the accessibility gate. The only reason I didn't promote it to critical is that it's been this way for more or less the entire history of Drupal.

xjm’s picture

Issue summary: View changes

Removing the legacy pre-8.0.0 beta phase evaluation (!) from the IS, although keeping the explanation of why it's a major accessibility issue. The beta evaluation had correctly identified that the issue was major and the reason for it, but somehow the issue priority didn't ever actually get set that way.

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new19.19 KB

Re-roll patch created for 9.3.x.

vsujeetkumar’s picture

StatusFileSize
new19.22 KB
new763 bytes

Fixed the "custom command fail issues".

Status: Needs review » Needs work

The last submitted patch, 291: 867830-291.patch, failed testing. View results

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new34.48 KB
new15.7 KB

Fixed the fail tests, Please have a look.

Status: Needs review » Needs work

The last submitted patch, 293: 867830-293.patch, failed testing. View results

xjm’s picture

The test fail is related to a theme system issue:

node.css is in the theme's /classy subdirectory, but the file contents no longer match the original file from Classy. This should be moved to a new directory and libraries should be updated. The file can be removed from the data provider.

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new33.96 KB
new1.03 KB

@xjm the above fail test is now fixed, however I am facing the "custom command fail" issues mentioned below, Please have a look and advise.

Error: No files matching the pattern "/var/www/html/core/themes/claro/css/classy/components/node.css" were found.
at /var/www/html/core/node_modules/stylelint/lib/standalone.js:212:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

pasqualle’s picture

Status: Needs review » Needs work

As mentioned in comment #263 it would be really bad to change or remove template variables without proper notice.
see #3270148: Provide a mechanism for deprecation of variables used in twig templates

I would suggest to use a new variable "status_marker" and mark the old ones deprecated.

The list of themes changed in Drupal 10, patch needs to be updated.
Requires a change record, with a possible explanation how to use the status marker with custom content entities with status, for example paragraphs. Also how to use it in custom themes.

mgifford’s picture

Issue tags: +wcag141

Adding WCAG SC 1.4.1

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ricksta’s picture

I have nothing new to add here other than to say I support the approach and points brought up in 300.

vsujeetkumar’s picture

StatusFileSize
new17.5 KB

Re-roll patch created for 11.x. And keeps as in "Need work" because some of the comments are still unaddressed.

Some of the theme files changes has been removed because of those are not part of current version.

mgifford’s picture

@vsujeetkumar it has been 2 years, so this will need to be re-rolled.

What comments are still unaddressed?

@pasqualle suggested an approach that @ricksta recommended. I think the summary there is new variable "status_marker" and mark the old ones deprecated.

We would need a new variable name I think.

lauriii’s picture

There was a solution implemented for canonical entity routes in #3501332: Display content moderation state in the Navigation Top Bar which is worth noting here.

mgifford’s picture

I tried to update the patch here https://git.drupalcode.org/issue/drupal-867830/-/compare/11.x...867830-u...

The numbering may not matter, but because @lauriii is wonderful, the numbers aren't what I thought they were.

I think these are complementary issues, but definitely related.

markconroy’s picture

Issue summary: View changes
StatusFileSize
new126.38 KB

For LocalGov Drupal's base theme we created some theme settings for "Add pink background to unpublished items" and "Add "Draft:" to the title of unpublished nodes.

LocalGov Base theme settings

I'm not suggesting we create theme settings here, but the approach of prepending "Draft" to titles has worked very well for councils, and does not affect the length of the title very much. So instead of a node title like "Council Tax" you get "Draft: Council Tax", with the option to also add the pink background (which is a CSS variable so you can put whatever colour you want in via CSS).

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.