Problem/Motivation

When creating a new content type, the default value for the "Promoted to front page" checkbox should be FALSE.

Proposed resolution

Set the default value of promote to FALSE in Node's base field definition
This value propagates to the Node type on save via base field override configuration

Existing node types will need an upgrade path to create base_field_override config to maintain the previous default setting.

Remaining tasks

Write upgrade path for existing node types
Review
Commit

User interface changes

Promoted to frontpage checkbox on Node Type form defaults to unchecked.

Release notes snippet

The Promoted to frontpage checkbox on he Node Type form defaults to unchecked.

CommentFileSizeAuthor
#232 987238-nr-bot.txt91 bytesneeds-review-queue-bot
#227 987238-nr-bot.txt6.98 KBneeds-review-queue-bot
#187 promoted_to_front-987238-187.patch5.57 KBlluvigne
#187 interdiff-987238-178-187.txt1.99 KBlluvigne
#178 Unchecked-patch-987238-177-8.patch3.58 KBajalan065
#175 After_patch_2.JPG98.09 KBTrupti Bhosale
#175 After_patch_1.JPG120.83 KBTrupti Bhosale
#175 Applied_patch.JPG84.09 KBTrupti Bhosale
#169 Unchecked-promoted-front-page-987238-170-8.patch3.61 KBajalan065
#165 Unchecked-promoted-next-page-987238-154-8.patch2.21 KBajalan065
#157 Unchecked-promoted-next-page-987238-154-8.patch2.08 KBajalan065
#152 Unchecked-promoted-front-page-987238-151-8.patch3.19 KBajalan065
#145 DO987238-defaults-published-not-promoted.png35.97 KBkattekrab
#142 promoted_to_front-987238-141.patch3.58 KBalvar0hurtad0
#137 create-article-withpatch.png24.57 KBrootwork
#137 create-article-withoutpatch.png24.86 KBrootwork
#137 add-content-type-withpatch.png40.11 KBrootwork
#137 add-content-type-withoutpatch.png49.77 KBrootwork
#136 interdiff-136-134.txt858 bytesidebr
#136 987238-136.patch3.63 KBidebr
#134 interdiff-134-131.txt611 bytesidebr
#134 987238-134.patch3.68 KBidebr
#131 promoted_to_front-987238-130.patch3.75 KBpawelgorski87
#130 987238-130.patch3.09 KBjain_deepak
#127 interdiff-127-125.txt894 bytesidebr
#127 987238-127.patch3.68 KBidebr
#125 987238-124.patch2.81 KBidebr
#120 promoted_to_front-987238-120.patch1.44 KBhussainweb
#118 promoted_to_front-987238-118.patch557 bytesnetlooker
#113 987238-Promoted-to-front-page-false-by-default-113.patch416 bytesnsuit
#111 987238-Promoted-to-front-page-false-by-default-111.patch412 bytesnsuit
#109 987238-Promoted-to-front-page-false-by-default-109.patch982 bytesnsuit
#103 987238-Promoted-to-front-page-should-be-false-by-default-103.patch570 bytescolinafoley
#90 987238-Promoted to front page should be false by default.patch.patch951 bytesmehuls
#87 drupal-set_promoted_to_front_to_false-987238-87.patch618 bytesinternetdevels
#83 promoted-to-front-page-default-987238-83.patch2.76 KBpflame
#77 interdiff.txt1023 bytesLinL
#76 promoted-to-front-page-default-987238-76.patch4.59 KBLinL
#76 interdiff.txt1.03 KBLinL
#74 promoted-to-front-page-default-987238-74.patch3.59 KBLinL
#72 drupal-node_type_promoted-987238-72.patch3.65 KBjlbellido
#72 interdiff.txt2.56 KBjlbellido
#67 drupal-node_type_promoted-987238-67.patch4.45 KBvito_a
#64 drupal-node_type_promoted-987238-64.patch4.45 KBdisasm
#62 node-type-promoted-987238-62.patch4.45 KBrootwork
#62 interdiff.txt672 bytesrootwork
#56 drupal8.node-type-promoted.56.patch4.45 KBlangworthy
#48 drupal8.node-type-promoted.48.patch4.42 KBCauliflower
#43 drupal8.node-type-promoted.43.patch4.3 KBaLearner
#43 interdiff.txt366 bytesaLearner
#33 drupal8.node-type-promoted.33.patch4.31 KBaLearner
#33 interdiff.txt1013 bytesaLearner
#20 content_type_default_not_promoted-987238-20.patch3.24 KBjenlampton
#15 content_type_default_not_promoted-987238-14.patch1.96 KBkim.pepper
#11 content_type_default_not_promoted-987238-11.patch2.56 KBjenlampton
#11 content_type_default_not_promoted-987238-11-D7.patch2.51 KBjenlampton
#8 content_type_default_not_promoted-987238-8.patch1.43 KBjenlampton
#8 content_type_default_not_promoted-987238-8.patch1.43 KBjenlampton
#8 content_type_default_not_promoted-987238-8-D7.patch1.41 KBjenlampton

Issue fork drupal-987238

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

devin carlson’s picture

Status: Active » Closed (fixed)

Drupal 7 now includes the ability to specify default publishing options using the configure content types interface.

David_Rothstein’s picture

Version: 7.x-dev » 8.x-dev
Status: Closed (fixed) » Active

This is not fixed in Drupal 7. When creating a new content type, the "promoted to front page" checkbox is still checked by default, but this issue proposes having it unchecked by default.

Reopening and moving to Drupal 8.

LarsKramer’s picture

Component: node system » node.module

Well, if you set the default value to FALSE, some people would argue that it should be TRUE. People will always have different needs, and I think the current defaults are sensible in most cases.

I think the solution to this would be to allow the site builder to modify the default content type settings (not only publishing status) so that next time he adds a new content type those settings would be used. This might be accomplished by adding a "settings" menu tab to "admin/structure/types"

If you agree, we might change the issue title to reflect this.

jenlampton’s picture

People will always have different needs, but its important that we try to do what the majority of people want, by default. Since the majority of people building sites want this box un-checked that's what it should be. We can check it for articles in the standard install profile, but let's not inconvenience most people most of the time by setting the wrong default. :)

I think adding another layer of abstraction by allowing people to set default-defaults is totally the wrong way to go. Let's just set the right defaults the first time and let it be.

LarsKramer’s picture

FYI: There is now a contributed module that allows you to change the default content type settings:
Content Type: Extras.

Everett Zufelt’s picture

Agree with approach in #4.

haydeniv’s picture

Issue tags: +D8UX usability

While I agree with #4, I would like some actual data to prove that most people want the check box un-checked. I for one would love to see it default to un-checked for everything but articles. How many people are going to promote the about us page to the front page? Also "Page" content types don't work well for the default /node home page long list of articles.
Thoughts? Someone feel like putting up a poll somewhere or some UX testing? It seems to me that most sites are not going to use /node for their home page and will use some other mechanism (workflow, taxonomy, panels) to determine home page content.

jenlampton’s picture

@haydeniv, That sounds good. I've set the default to only publish by default (and not promote) but I've adjusted the standard profile so that Articles are still promoted.

This frustrates me in D7 too... Wonder what the likelyhood is of getting a backport :)

jenlampton’s picture

That first patch has extra whitespace, sorry thought I had removed it.

Everett Zufelt’s picture

book.install:

  // Default to not promoted.
  variable_set('node_options_book', array('status'));

forum.install:

  // Forum topics are published by default, but do not have any other default
  // options set (for example, they are not promoted to the front page).
  variable_set('node_options_forum', array('status'));

You might consider removing these statements, as with your patch they are now the default for a new node type.

jenlampton’s picture

Good idea! :)
Aah, Less code feels good, doesn't it? even just a few lines :)

Status: Needs review » Needs work
Issue tags: -Novice, -D7UX usability, -D8UX usability

The last submitted patch, content_type_default_not_promoted-987238-11.patch, failed testing.

jenlampton’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Novice, +D7UX usability, +D8UX usability

The last submitted patch, content_type_default_not_promoted-987238-11.patch, failed testing.

kim.pepper’s picture

Re-rolled patch from #11 to fix failing book module test.

Kim

kim.pepper’s picture

Status: Needs work » Needs review

Marking needs review

Everett Zufelt’s picture

I think that this needs another review, but +1 from me.

jdsaward’s picture

Status: Needs review » Reviewed & tested by the community

Also tested this patch, works fine!

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs work

I think this is good, but still needs some more work.

  1. Removing the Book module part of the patch looks like working around the failing test rather than fixing it. We need to find the root cause.
  2. With the patch applied, I still see one place in node.module that uses array('status', 'promote') as the default value of the variable. That needs to be changed also. I would say this is a good candidate for the actual cause of the Book module failing test...
  3. Don't we need an update function to explicitly set these variables, for sites that were relying on the previous default behavior?
jenlampton’s picture

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

1. agree.
2. I couldn't for the life of me figure out why book module was failing the test - maybe that's it. Let's give it a try.
3. No, I don't think so. This is the default for the content type form, and as soon as a content-type is created, those values are saved - and the defaults don't matter anymore. If people didn't like the defaults they would have changed them. If people did like the defaults, they would already be saved how they want them. I don't think there's anything to update. Actually, I think if we did change the behaviour of existing content, people would get upset :)

Everett Zufelt’s picture

We do need update functions

Example:

+  // Default "Article" to be promoted.
+  variable_set('node_options_article', array('status', 'promote'));

This is the code that will b in a D8 install (the variable will be set, in D7 sites upgraded to D8 the variable will not be set, and will fall back to using node.module's default of not promoted.

Edit:

The variable * may * not be set, so the update function should check for that and only set the variable if it is not set. I think we only need this for Article, as I believe it is the only promoted by default. I'm not sure if install profiles can implement hook_update_N(), if so it should goo in standard.install.

haydeniv’s picture

Status: Needs review » Needs work

#20 applies clean and works as expect. No checkbox. Just need update function and good to go I think.

David_Rothstein’s picture

The variable * may * not be set, so the update function should check for that and only set the variable if it is not set. I think we only need this for Article, as I believe it is the only promoted by default.

"Article" might be the only example in core where this can happen, but there could be issues with non-core content types also. Basically, this scenario can arise for any content type that was programmatically installed (by a module or install profile) and did not set this variable, and then the site admin never saved the edit form for this content type so it never got saved to the database that way either.

So I think the update function needs to loop through all content types and check each one using the method you described.

devin carlson’s picture

aLearner’s picture

Assigned: Unassigned » aLearner

I'll attempt to make the changes to the update function as described in Comment # 23.

webchick’s picture

Hm. Without something views-like in core, this strikes me as a rather bad idea. All nodes will default to ending up in the node orphanage. :\ I wonder if we should postpone this on #1210366: Per-bundle node listing pages, blocks, feeds..

Also, I don't think this behaviour change is back-portable to D7. For better or worse, this behaviour has been baked in not only for 10+ point releases of D7 but since time immemorial. Doesn't mean we shouldn't change it in D8, but it does mean it's a fairly jarring difference that we shouldn't just spring on people during a stable release.

jenlampton’s picture

Issue tags: -D7UX usability

I think I agree with you that it's not backportable to D7.

But I still hold that listing pages in core or not, we should not force everyone who creates a new content type to uncheck that box more than 80% of the time when they are filling out the form. It's frustrating, and after doing it 100 times or so, you start to wonder "why the heck is this box checked by default, anyway?" and I don't think a "because people can loose content into the node orphanage" is a good answer. I think the node orphanage problem needs to be solved in a way that makes more sense than "we'll just put everything on the home page by default".

No one wants either of those things! Let's make things people do want :) Oh, and let's make them shiny.

webchick’s picture

I think the node orphanage problem needs to be solved in a way that makes more sense than "we'll just put everything on the home page by default"

Well I certainly can't argue with that. :) Thanks for removing the backport tags. I think as long as this is not on the table for D7, it can be evaluated on its own merits in D8-land.

PS: And with ponies??

yoroy’s picture

Reading this I could not find an explanation of what 'the node orphanage' is supposed to mean. What does it mean? Thanks :)

David_Rothstein’s picture

I think the "node orphanage" is where you create a node and can't find it anywhere on your site... But, I thought that was a Drupal 6 problem, pretty much dealt with in Drupal 7?

Either way, this issue is definitely Drupal 8 only.

webchick’s picture

The node orphanage is admin/content/node. Users' first encounter with the node orphanage is when they create a Basic page without a menu attached. You go through the steps to create a node, then navigate away, then your content is lost. Befuddled, you go wandering around looking for it, perhaps re-creating your content again since it seems like the system ate it. Finally, in desperation you click "Find content" where you will see your content sitting in amongst the other poor pieces of content with no home and no family. *queue the tragic cello music*

sun’s picture

@aLearner is about to come up with a freakin' patch! :)

aLearner’s picture

Status: Needs review » Needs work
StatusFileSize
new1013 bytes
new4.31 KB

I'm grateful to sun for helping me create the patch step-by-step. The credit for the patch truly goes to sun.

Special thanks to jenlampton, webchick and xjm for their support throughout this process.

aLearner’s picture

Status: Needs work » Needs review
aLearner’s picture

Status: Needs work » Needs review

Hello,

Here's an update detailing what I did to manually test the patch. I've broken the post up into several sections:

[a] Setup
[b] Pre-Patch Application Observations
[c] Application of Patch
[d] Post-Patch Application Observations
[e] Update
[f] Post-Patch Application and Update Observations

Setup

I installed a fresh copy of D8. This included dropping all the tables in the database. Then, I proceeded to reset the git repo by typing the command

git reset --hard

from the root directory of the D8 installation.

Pre-Patch Application Observations

[1] Then, on the site, I navigated to

Content --> Add Content --> Article --> Publishing options

I noticed that the following

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

[2] I then clicked on 'Add content' (left-hand corner) and then on

Basic page --> Publishing options

I noticed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

[3] Then I clicked on

Structure --> Content types --> Add content type

I filled up only the 'Name' field with the following name

Content Type 1

and hit

Save content type

at the bottom of the screen.

Then I navigated to

Content --> Add Content --> Content Type 1 --> Publishing options

I observed the following

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

I then scrolled back up and filled up the following title

A Sample of Content Type 1

and then scrolled back down and hit 'Save'.

[4] Using the steps detailed in [3] I created another content type and called it 'Content Type 2'.

Then I navigated to

Content --> Add Content --> Content Type 2 --> Publishing options

I observed the following

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

I then scrolled back up and filled up the following title

A Sample of Content Type 2

Then, I unchecked

Promoted to front page

and then scrolled back down and hit 'Save'.

This marked the end of
[a] Setup
[b] Pre-Patch Application Observations

aLearner’s picture

Application of Patch

I took the following steps to apply the patch. From the root directory of the D8 installed, I typed in

wget http://drupal.org/files/drupal8.node-type-promoted.33.patch

and then

patch -p1 < drupal8.node-type-promoted.33.patch

I noticed that the patch was successfully applied.

Post-Patch Application Observations

[1] Then, on the site, I navigated to

Content --> Add Content --> Article --> Publishing options

I noticed that the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: 'Promoted to front page' went from being checked to not checked for 'Article'.

Question 1: Is this a problem?

[2] I then clicked on 'Add content' (left-hand corner) and then on

Basic page --> Publishing options

I noticed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

[3] I then clicked on 'Add content' (left-hand corner) and then on

Content Type 1 --> Publishing options

I noticed the following

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

I then clicked on 'Content'

A Sample of Content Type 1 --> Edit --> Publishing options

I noticed the following

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

[4] I then clicked on 'Content'

A Sample of Content Type 2 --> Edit --> Publishing options

I noticed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

[5] Then I clicked on

Structure --> Content types --> Add content type

I filled up only the 'Name' field with the following name

Content Type 3

and hit

Save content type

at the bottom of the screen.

Then I navigated to

Content --> Add Content --> Content Type 3 --> Publishing options

I observed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: 'Promoted to front page' went from being checked to not checked.

This marked the end of
[c] Application of Patch
[d] Post-Patch Application Observations

aLearner’s picture

Update

To perform an update, I typed in

http://localhost/myDrupalInstallDirectory/update.php

then I clicked on 'Continue'. I saw

1 Pending Update

with the following description

node module

8001 - Change default promoted flag of node types to disabled. The default for 'Promoted to front page' was changed from enabled to disabled. Since enabled was the implicit default previously, and may not have been explicitly configured as such, this update ensures that the old implicit default is still the default. @see http:drupal.orgnode987238

I then clicked on

Apply pending updates.

The update ran successfully.

Post-Patch Application and Update Observations

[1] Then, on the site, I navigated to

Content --> Add Content --> Article --> Publishing options

I noticed that the following

Published was not checked
Promoted to front page was checked
Sticky at top of lists was not checked

Result:
'Published' went from being checked to not checked for 'Article'.
'Promoted to front page' went from being not checked to checked for 'Article'.

Question 2: Is this a problem?

[2] I then clicked on 'Add content' (left-hand corner) and then on

Basic page --> Publishing options

I noticed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

[3] I then clicked on 'Add content' (left-hand corner) and then on

Content Type 1 --> Publishing options

I noticed the following

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

I then clicked on 'Content'

A Sample of Content Type 1 --> Edit --> Publishing options

I noticed the following

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

[4] I then clicked on 'Content'

A Sample of Content Type 2 --> Edit --> Publishing options

I noticed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

[5] Then I clicked on

Structure --> Content types --> Add content type

I filled up only the 'Name' field with the following name

Content Type 4

and hit

Save content type

at the bottom of the screen.

Then I navigated to

Content --> Add Content --> Content Type 4 --> Publishing options

I observed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied.

This marked the end of
[e] Update
[f] Post-Patch Application and Update Observations

and concluded my testing.

The two outstanding questions revolve around the behavior of 'Article'. Hopefully, this can be cleared up.

dig1’s picture

Hi, my observations were:

1) Installed Drupal8.x.dev
- Content Type Article Published=Yes Promoted=Yes
- Content Type Basic Published=Yes Promoted=No

2) Apply Patch http://drupal.org/files/drupal8.node-type-promoted.33.patch

3) Reports - Status - Update DB
- Content Type Article Published=NO Promoted=Yes
- Content Type Basic Published=Yes Promoted=No

4) Create Content Type Test
- Content Type Test Published=Yes Promoted=No

Summary = The patch is accidentally changing existing Content Type Article from Published to NOT Published, so we need to look at the patch code/instructions. Other than that it seems to work...:)

aLearner’s picture

Dig1,

Thanks very much for your help. Also, thank you for confirming that 'Article' is indeed behaving not as expected.

yoroy’s picture

Status: Needs review » Needs work

Thanks all. Seems this needs work :)

David_Rothstein’s picture

Thanks for all the testing.

Question #1 seems like expected behavior since the update function had not run yet. So it does seem like the only problem is that the default is being changed from published to unpublished. I guess this can be fixed by setting $options['status'] in the update function?

Another thought:

+ *
+ * @see http://drupal.org/node/987238

Normally there's no reason to @see the issue unless there's some specific discussion that needs to be referenced, which I don't think is the case here? However, I see you copied this directly from node_update_8000() which has a @see also... Honestly, it should probably be removed from both places - both update functions are pretty straightforward and in my opinion the code comments explain the rationale for them just fine on their own :)

aLearner’s picture

Status: Needs review » Needs work

yoroy,

Thank you for your input.

David_Rothstein,

Thank you for your insight. I'll make the changes as you suggested. Thanks again.

I do have one question though.

Question #1 seems like expected behavior since the update function had not run yet.

But do we really want 'Article' to change its behavior when the patch is applied? I thought that, by default, 'Article' should always have 'Promoted to front page' checked.

Note: My question was answered by David_Rothstein on IRC. Thank you.

aLearner’s picture

Status: Needs work » Needs review
StatusFileSize
new366 bytes
new4.3 KB

OK. Per David_Rothstein's suggestion, I added in the line

$options['status'] = 'status';

in the function

function node_update_8001

A big thank you to David_Rothstein for all his help.

Also, a shout-out to cweagans and volkman for their assistance in creating the patch and interdiff files.

aLearner’s picture

Hi,

These are the steps I took to test my patch:

[1] Installed Drupal8.x.dev

[2] Went to

Content --> Add Content --> Article --> Publishing options

Noted that

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

[3] Applied the patch located at

http://drupal.org/files/drupal8.node-type-promoted.43.patch

[4] Updated the site by navigating to

mySiteURL/update.php

and applied the one pending update.

[5] Went to

Content --> Add Content --> Article --> Publishing options

Noted that

Published was checked
Promoted to front page was checked
Sticky at top of lists was not checked

Result: There was no difference after the patch was applied. This is the expected behavior. The bug seems to be fixed.

[6] Then I clicked on

Structure --> Content types --> Add content type

I filled up only the 'Name' field with the following name

Content Type 1

and hit

Save content type

at the bottom of the screen.

Then I navigated to

Content --> Add Content --> Content Type 1 --> Publishing options

I observed the following

Published was checked
Promoted to front page was not checked
Sticky at top of lists was not checked

Result: 'Promoted to front page' went from being 'checked' to 'not checked'. This is the expected behavior.

Conclusion

It would be great if someone could-cross check my work to make sure the bug is fixed.

Also, should we be also adding a line like

$options['sticky'] = 'sticky';

to make sure that this doesn't have the same bug caused by not having the line

$options['promote'] = 'promote';

previously. So, I'm asking if the if-conditional inside the function

function node_update_8001() (around Line # 535)

located in the file

core/modules/node//node.install

Should look something like this

...
 if (!isset($options)) {
      $options['promote'] = 'promote';
      $options['sticky'] = 'sticky'; // Wondering if this line should be included just like the above line was added
      $options['status'] = 'status';
      variable_set("node_options_$type", $options);
    }
...
David_Rothstein’s picture

Status: Needs work » Needs review

I reviewed this latest patch and tested it, and I think it's ready to go. I don't think we need a line for $options['sticky'] since that was not previously set by default (only 'status' and 'promote' were).

The only remaining question is the "node orphanage" issue mentioned above. I don't think we should postpone this issue on that (we need other issues to solve that problem either way; probably something like #504012: Use a queue for node create/update indexing is at least part of the solution?). It's less of a problem in Drupal 7 than it was in Drupal 6, and hopefully it can be even better in Drupal 8... Nonetheless, I didn't mark the patch RTBC yet because that discussion didn't seem quite finished.

Oh, as an aside... if you have the "interdiff" command line tool installed on your system (it's easily available in Linux for example), you can generate an easier-to-read interdiff file using that, e.g. interdiff -p1 patch1.patch patch2.patch > interdiff.txt

aLearner’s picture

David_Rothstein,

Thank you for testing the patch. Thank you also for answering my question. This makes sense. I'm glad you think that the patch is RTBC.

I don't really understand the orphanage issue but if there's something I can do to help, I'm glad to do it.

Thanks for the pointer regarding the 'interdiff' command line too. I do have it installed. Next time I'll use the command you suggested to generate the 'interdiff.txt' file.

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/core/modules/node/node.installundefined
@@ -525,6 +525,28 @@ function node_update_8000() {
+ * Change default promoted flag of node types to disabled.

This seems to disagree with the rest of the comment, and the function itself. Doesn't the function actually set the promoted flag of existing not types to enabled?

Cauliflower’s picture

StatusFileSize
new4.42 KB

I think you're right, the comment wasn't correct. The patch attached has the correct comment. I also had to rewrite the patch because a lot has changed since February.

Cauliflower’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal8.node-type-promoted.48.patch, failed testing.

Cauliflower’s picture

Mmmm, strange... Even if I didn't touch the aggregator module, the test fails. I'm a newbie, anaybody any suggestions how to fix this ? Thx!

Cauliflower’s picture

Status: Needs work » Needs review
Issue tags: -Novice, -D8UX usability

Status: Needs review » Needs work
Issue tags: +Novice, +D8UX usability

The last submitted patch, drupal8.node-type-promoted.48.patch, failed testing.

xjm’s picture

Assigned: aLearner » Unassigned

 

Renee S’s picture

It has something to do with the function node_update_8004() -- it looks like testbot objects to the mysql update as it is making a change that is affecting the RSS feed items (which makes sense, as things that weren't promoted before are promoted now.)

Not sure how to go about reassuring it, though...

langworthy’s picture

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

re-roll

Status: Needs review » Needs work
Issue tags: -Novice, -D8UX usability

The last submitted patch, drupal8.node-type-promoted.56.patch, failed testing.

rootwork’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Novice, +D8UX usability

The last submitted patch, drupal8.node-type-promoted.56.patch, failed testing.

rootwork’s picture

Status: Needs work » Needs review

This patch applied fine locally and on simplytest.me so I'm confused why it's failing testing here.

rootwork’s picture

Status: Needs review » Needs work

Oops, sorry, switching back to needs work.

rootwork’s picture

Status: Needs work » Needs review
Issue tags: +SprintWeekend2013
StatusFileSize
new672 bytes
new4.45 KB

Ah, the node update ID was wrong.

Attaching a new patch and interdiff, since it was just one character that changed.

Status: Needs review » Needs work

The last submitted patch, node-type-promoted-987238-62.patch, failed testing.

disasm’s picture

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

Rerolling patch.

Status: Needs review » Needs work

The last submitted patch, drupal-node_type_promoted-987238-64.patch, failed testing.

vito_a’s picture

Assigned: Unassigned » vito_a
Issue tags: +CodeSprintUA
vito_a’s picture

Assigned: vito_a » Unassigned
Status: Needs work » Needs review
Issue tags: -CodeSprintUA
StatusFileSize
new4.45 KB

Re-rolling the #64.

vito_a’s picture

Issue tags: +CodeSprintUA

Re-applying a tag.

Status: Needs review » Needs work
Issue tags: -Novice, -D8UX usability, -SprintWeekend2013, -CodeSprintUA

The last submitted patch, drupal-node_type_promoted-987238-67.patch, failed testing.

vito_a’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Novice, +D8UX usability, +SprintWeekend2013, +CodeSprintUA

The last submitted patch, drupal-node_type_promoted-987238-67.patch, failed testing.

jlbellido’s picture

StatusFileSize
new2.56 KB
new3.65 KB

I don't know why but this code makes to fail the test :

diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 4bc59fe..986c50d 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -28,7 +28,7 @@ class NodeFormController extends EntityFormController {
-    $node_options = variable_get('node_options_' . $node->type, array('status', 'promote'));
+    $node_options = variable_get('node_options_' . $node->type, array('status'));

Added new patch that change update_N() and remove this change, But i think that this needs work.

jlbellido’s picture

Status: Needs work » Needs review
LinL’s picture

Here's a new patch now that #111715: Convert node/content types into configuration has landed.

Only the article type is promoted by default, any new content types added will default to not promoted.

Manual testing seems OK, let's see...

Status: Needs review » Needs work

The last submitted patch, promoted-to-front-page-default-987238-74.patch, failed testing.

LinL’s picture

Status: Needs work » Needs review
StatusFileSize
new1.03 KB
new4.59 KB

Can I just change the AggregatorTestBase.php test?

LinL’s picture

StatusFileSize
new1023 bytes

Sorry, messed up interdiff in #76. Here it is again.

Status: Needs review » Needs work
Issue tags: -Novice, -D8UX usability, -SprintWeekend2013, -CodeSprintUA

The last submitted patch, promoted-to-front-page-default-987238-76.patch, failed testing.

yoroy’s picture

Bump. (I was actually looking for the issue that disabled comments on new content types but that is solved now with comments-as-fields :-)

This issue here would still be a nice tweak towards more sensible defaults.

xjm’s picture

Component: node.module » node system
Issue summary: View changes

(Merging "node system" and "node.module" components for 8.x; disregard.)

pflame’s picture

Assigned: Unassigned » pflame

I am working on rerolling this patch to latest version of 8.x.

pflame’s picture

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

I reroll this patch to latest version of drupal 8. By default add content type form Promote to front checkbox is un checked, but for article content type it will be checked default.

pflame’s picture

I am working on updating the issue summary by following the instructions at https://drupal.org/contributor-tasks/write-issue-summary

Status: Needs review » Needs work

The last submitted patch, 83: promoted-to-front-page-default-987238-83.patch, failed testing.

The last submitted patch, 83: promoted-to-front-page-default-987238-83.patch, failed testing.

internetdevels’s picture

Status: Needs work » Needs review
StatusFileSize
new618 bytes

May be we don't need this to be changed in tests.

Status: Needs review » Needs work

The last submitted patch, 87: drupal-set_promoted_to_front_to_false-987238-87.patch, failed testing.

The last submitted patch, 87: drupal-set_promoted_to_front_to_false-987238-87.patch, failed testing.

mehuls’s picture

rootwork’s picture

Status: Needs work » Needs review

Setting to needs review for testbot.

Status: Needs review » Needs work
rootwork’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
izus’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
penyaskito’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
gnuget’s picture

Assigned: pflame » Unassigned
Issue tags: +Needs issue summary update

This issue needs an summary update, here the instructions:
https://drupal.org/contributor-tasks/write-issue-summary

minneapolisdan’s picture

Issue summary: View changes
minneapolisdan’s picture

colinafoley’s picture

Assigned: Unassigned » colinafoley

I'm working on this.

colinafoley’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new570 bytes

Here's a new patch. The path changed from /core/modules/node/lib/Drupal/node/Entity/NodeType.php to /core/modules/node/src/Entity/NodeType.php

Status: Needs review » Needs work
rootwork’s picture

Seems like the tests will have to be updated to match — they must assume promote to front page being on.

ec1ipsis’s picture

Assigned: colinafoley » ec1ipsis

Working on fixing the test.

ec1ipsis’s picture

Assigned: ec1ipsis » Unassigned

Un-assigning from myself as I don't have enough time to fix this today. The Aggregator is working functionally but failing tests. The thinking is that it's using rss.xml, but content isn't going there automatically because nodes are no longer auto-promoted on new content types.

nsuit’s picture

I will attempt to look into the problem at the drupalcon sprint.

nsuit’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new982 bytes

Found a way to patch this. Thanks Dan!

Status: Needs review » Needs work

The last submitted patch, 109: 987238-Promoted-to-front-page-false-by-default-109.patch, failed testing.

nsuit’s picture

Status: Needs work » Needs review
StatusFileSize
new412 bytes

Last patch combined my patch with the previous one by mistake. Here is the patch again.

Status: Needs review » Needs work

The last submitted patch, 111: 987238-Promoted-to-front-page-false-by-default-111.patch, failed testing.

nsuit’s picture

Status: Needs work » Needs review
StatusFileSize
new416 bytes

Trying to see if using FALSE instead of 0 as an argument makes a difference in having this patch pass the automated tests.

Status: Needs review » Needs work

The last submitted patch, 113: 987238-Promoted-to-front-page-false-by-default-113.patch, failed testing.

nsuit’s picture

Status: Needs work » Needs review

As D8WTF! at drupalcon sprint and footwork in #105 suggested, some of the automated tests need maybe to be rewritten?

dcam’s picture

Yes, you'll need to make an adjustment to the Aggregator test base, but it should be a small one.

Aggregator's tests rely on the RSS feed generated by the default front page. It's the easiest way to get an RSS feed for import testing. Of course, it's relied on the nodes it creates being automatically promoted to the front page. This change is disrupting that.

Check out createSampleNodes() in /core/modules/aggregator/src/Tests/AggregatorTestBase.php. Add a line to the $edit array which checks the Promote to Front Page checkbox. Then I bet everything will start passing.

alansaviolobo’s picture

netlooker’s picture

Issue tags: +DUGBE1409
StatusFileSize
new557 bytes

I've reviewed the path from #113 and I thought that it is a little bit workaround solution. So I've decided to search for a better place for setting the promotion field value.

Status: Needs review » Needs work

The last submitted patch, 118: promoted_to_front-987238-118.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new1.44 KB

I went through the first few comments in this thread and the recent patches. It seems that we are not caring about the defaults on new node type forms (or I might have missed a comment about that).

Anyway, here is the patch with a test change for aggregator. It fixes various tests in aggregator. I hope it fixes all. More fixes later.

Status: Needs review » Needs work

The last submitted patch, 120: promoted_to_front-987238-120.patch, failed testing.

yesct’s picture

Issue summary: View changes
Issue tags: -Novice

doing https://www.drupal.org/contributor-tasks/update-allowed-beta
evaluating https://www.drupal.org/contribute/core/beta-changes

also removing novice tag per https://www.drupal.org/core-mentoring/novice-tasks
this is a bit more difficult that a straight forward novice task.

yesct’s picture

Issue tags: +Usability
idebr’s picture

This issue is like time travelling :)

This issue would still be nice to include in D8 I think. Patch attached.

Status: Needs review » Needs work

The last submitted patch, 125: 987238-124.patch, failed testing.

idebr’s picture

StatusFileSize
new3.68 KB
new894 bytes

This should fix the remaining tests.

idebr’s picture

Status: Needs work » Needs review
jsobiecki’s picture

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

I'm filling this comment on behalf user PawelGorski87, who has some problems with form submission (untrusted user). Pawel is working on reported problem.

Patch #127 don't apply with latest codebase 8.0.x branch. Patch needs re-roll. I'm working on it.
git apply -v /c/patch/987238-127.patch

Checking patch core/modules/aggregator/src/Tests/AggregatorTestBase.php...
Checking patch core/modules/node/src/Entity/Node.php...
Checking patch core/modules/node/src/Tests/Views/NodeLanguageTest.php...
Checking patch core/modules/taxonomy/src/Tests/RssTest.php...
 error: while searching for:
  protected function setUp() {
     parent::setUp();
    $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'by
 pass node access', 'administer content types', 'administer node display'));
     $this->drupalLogin($this->admin_user);
     $this->vocabulary = $this->createVocabulary();
jain_deepak’s picture

Status: Needs work » Needs review
Issue tags: +SprintWeekend2015
StatusFileSize
new3.09 KB

Rerolled

pawelgorski87’s picture

Issue tags: -Needs reroll
StatusFileSize
new3.75 KB

I fixed last patch version. Patch tested with latest codebase 8.0.x branch.

The last submitted patch, 130: 987238-130.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 131: promoted_to_front-987238-130.patch, failed testing.

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new3.68 KB
new611 bytes
hussainweb’s picture

Status: Needs review » Needs work
+++ b/core/modules/taxonomy/src/Tests/RssTest.php
@@ -42,7 +42,8 @@ class RssTest extends TaxonomyTestBase {
-    $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access', 'administer content types', 'administer node display']));
+    $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access', 'administer content types', 'administer nodes', 'administer node display'));
+    $this->drupalLogin($this->admin_user);

Why is this changed? Is there a admin_user property on the class? This does not look related to the issue on hand either.

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new3.63 KB
new858 bytes

@hussainweb You are correct, nice catch :). This change was introduced in #131 in a reroll.

I changed the code back to its current version and added the 'administer nodes' permission that is necessary for admins to be able to promote a node to the frontpage.

rootwork’s picture

Here are screenshots of the behavior--

Add new content type without patch:
add content type without patch

Add new content type with patch:
add content type with patch

Note this patch also changes the default behavior of the Article content type on a Standard install to not posting on the front page. I'm not sure if that's intentional or not.

Here's Add Article without patch:
add article without patch

And Add Article with patch:
add article with patch

kattekrab’s picture

Should we bump this forward to 8.1.x or is it still an 8.0.x contender?

At any rate, this needs a reroll.

Also - did we end up getting any data on majority preference for the default?

kattekrab’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
alvar0hurtad0’s picture

Assigned: Unassigned » alvar0hurtad0
alvar0hurtad0’s picture

Version: 8.0.x-dev » 8.1.x-dev
Assigned: alvar0hurtad0 » Unassigned
StatusFileSize
new3.58 KB

Here's the reroll to the 8.1.x branch.

alvar0hurtad0’s picture

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

Sorry, the status.

Status: Needs review » Needs work

The last submitted patch, 142: promoted_to_front-987238-141.patch, failed testing.

catch’s picture

Tagging.

kattekrab’s picture

Issue summary: View changes
StatusFileSize
new35.97 KB

Manual test.

Needs work.

Article promotion options should still default to promoted to front page.

But the new content type no longer has that option ticked, which is great!

kattekrab’s picture

Title: "Promoted to front page" should default to Un-Checked » "Promoted to front page" for new content types should default to Un-Checked
Issue summary: View changes

Updated the title to make it clear this change is for NEW content types.

alvar0hurtad0’s picture

@kattekrab but that's what is required. isn't it?

Content types should define default options on creation. If one content type has been created previously have this options yet configured.

:)

kattekrab’s picture

@alvar0hurtad0

Not quite.
This is about changing the default setting when we create NEW content types.

The existing content type, "Article" should stay as it is. When new users start with Drupal, they are encourage to add content to their site. It is likely to be confusing if that new content doesn't appear on the front page.

The patch above changes the default setting for the existing out of the box "Article" content type, and it should not do that.

It should only change the default setting when creating a new content type.

Thanks for rerolling the patch though! It was great to be able to test it again after so long.

webchick’s picture

To make a product management call, the issue summary needs an actual problem/motivation. ;) The table mentions "usability" as the main reason for this proposed, but I don't quite understand that rationale.

I totally agree that this checkbox is a kludge, but it's arguably a useful one. It means new Drupal users always have a way to find the content that they posted; they don't disappear into the ether, only accessible at admin/content (which only admins have access to). Without some kind of replacement (e.g. a View that automatically creates tabs per content type?) if this checkbox is unchecked by default, it seems like the workflow becomes: 1) post a piece of content, 2) navigate away, 3) PANIC because your content is gone.

I'm sure I'm missing something, so let's get the full rationale in the issue summary.

kattekrab’s picture

Ok - I think we need some kind of evidence to support opinion.

Frankly - I feel this one is 50/50... I don't have a strong sense that I always prefer the default to be other than it is, some probably do, other probably want the default to promote to front page.

There were other issues though about whether the "promote to front page" flag itself makes sense...

I know I've used it as a quick and dirty way to do stuff in views in places other than the front page.

So... before we update the Issue Summary - should we conduct a quick sitebuilder poll?

When creating a new content type, would you prefer to see the "Promote to front page" checkbox on or off?
A. On! I like to see all new content appear on the front page so I can check it is ok.
B. Off! I like to choose whether or not new content should appear on the front page.

Or something like that...

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.

ajalan065’s picture

The patch did not apply cleanly.
So had to re-roll it.
Uploading the re-rolled patch.

ajalan065’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 152: Unchecked-promoted-front-page-987238-151-8.patch, failed testing.

The last submitted patch, 152: Unchecked-promoted-front-page-987238-151-8.patch, failed testing.

The last submitted patch, 152: Unchecked-promoted-front-page-987238-151-8.patch, failed testing.

ajalan065’s picture

Uploading the rerolled patch again for testing

ajalan065’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 157: Unchecked-promoted-next-page-987238-154-8.patch, failed testing.

rootwork’s picture

Status: Needs work » Needs review

Go go Drupal testbot

rootwork’s picture

Status: Needs review » Needs work

Whoops, sorry for the cross-post. Back to needs work since it didn't apply.

The last submitted patch, 157: Unchecked-promoted-next-page-987238-154-8.patch, failed testing.

ajalan065’s picture

Status: Needs work » Needs review

The patch is working fine on my local.. I am not able to get why it is failing the testings

gnuget’s picture

It could be because the branch where this patch has been tested.

I just queued the test in the 8.1.x branch let's see what the testbot says.

ajalan065’s picture

I viewed the output at the console..Its probably due to path conflict..Let's see whether this modified patch works....

The last submitted patch, 157: Unchecked-promoted-next-page-987238-154-8.patch, failed testing.

The last submitted patch, 157: Unchecked-promoted-next-page-987238-154-8.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 165: Unchecked-promoted-next-page-987238-154-8.patch, failed testing.

ajalan065’s picture

Uploading the rerolled patch with changes..

ajalan065’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 169: Unchecked-promoted-front-page-987238-170-8.patch, failed testing.

ajalan065’s picture

Status: Needs work » Needs review

The last submitted patch, 142: promoted_to_front-987238-141.patch, failed testing.

yoroy’s picture

Here’s a highly unscientific poll: https://twitter.com/royscholten/status/707697307173720065

I think this shows that it’s enough for only the default Article content type to have promoted on by default.

Trupti Bhosale’s picture

StatusFileSize
new84.09 KB
new120.83 KB
new98.09 KB

Verified the patch ' Unchecked-promoted-front-page-987238-170-8.patch' in comment #172 and the observations are as follows:
1.Warnings are displayed while applying the patch
2.Even after the patch is applied 'Promoted to front page' checkbox is still by default selected on Add Content type and Add Article page
Attached snapshot for reference.

Trupti Bhosale’s picture

Status: Needs review » Needs work
ajalan065’s picture

Hi Truptti,
The patch worked fine for me

ajalan065’s picture

StatusFileSize
new3.58 KB
ajalan065’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 178: Unchecked-patch-987238-177-8.patch, failed testing.

ajalan065’s picture

I applied the patch on a clean drupal install...It works... do not know why 3 tests fail..looking into it

naveenvalecha’s picture

We also need to update the default value in few failing testsCommentFieldsTest, ContextualDynamicContextTest, FrontPageTest

kattekrab’s picture

@yoroy ++

vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

Assigned: vprocessor » Unassigned
lluvigne’s picture

Assigned: Unassigned » lluvigne
Issue tags: +DrupalCampES
lluvigne’s picture

Assigned: lluvigne » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.99 KB
new5.57 KB

Hi,
i try to fix the failing tests. Hope it works!

naveenvalecha’s picture

Status: Needs review » Reviewed & tested by the community

looks good

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -Needs reroll +Needs change record

We still need a "Needs product manager review" and there is still no rationale for change in the issue summary. Also I think changing a default behaviour should have a change record.

alexpott’s picture

Status: Needs review » Needs work

Actually given that the product manager asked for an issue summary update in #149 setting to needs work for that.

webchick’s picture

Reviewed in #149; feel free to re-add the tag once the rationale is explained, esp. how to deal with the "node orphanage" problem that it will inevitably 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.

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.

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.

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.

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.

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.

acbramley’s picture

Issue tags: +Needs reroll

This issue still seems relevant, I'm surprised this default comes all the way from Node's field default value.

We'll need to start with a reroll of the changes onto an MR.

I also noticed that we have base_field_override config in the standard install profile that says the default value of this should be 0 but that doesn't seem to actually be used on install.

realityloop made their first commit to this issue’s fork.

xmacinfo’s picture

Based on #29338: Hide Promoted/Sticky fields by default in Form display, we should be marking this ticket as “Outdated” or “Duplicate”.

acbramley’s picture

@xmacinfo no - this is different. This is making the checkbox on the NodeType form itself to be unchecked.

xmacinfo’s picture

Yes, but if we remove the checkboxes on new install, we do not need to worry about the checkbox being unchecked.

acbramley’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update, -Needs reroll
acbramley’s picture

Issue summary: View changes
Issue tags: -Needs change record +Needs upgrade path

CR created https://www.drupal.org/node/3517642

We need an upgrade path here though unfortunately.

Currently if you:
1. Install Standard profile on 11.x
2. Check out this branch
3. Clear cache
4. Notice the Article node type no longer defaults to Promoted. Page correctly still defaults to Not Promoted because Standard ships with base_field_override config

acbramley’s picture

Yes, but if we remove the checkboxes on new install, we do not need to worry about the checkbox being unchecked.

We aren't removing checkboxes, we're hiding them. It actually makes more sense to default to unchecked once we hide the fields, otherwise new sites will be creating "promoted" content without the checkbox even being visible. We have to do things in small steps (see the history of this issue) otherwise we'll never get anywhere :) Just look at how many tests in core assume things are promoted by default!

acbramley’s picture

Added a basic upgrade path, needs tests though.

dcam’s picture

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

I added an update path test.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

So I tested it out and pretty basic, creating a new content type and the promoted to front checkbox is unchecked

Hiding old patches
Tweaked the CR just slightly with an image for the visual people out there.

I imagine this may break some contrib tests (hopefully not a lot) but seems like a right step.

benjifisher’s picture

We discussed this issue briefly at #3517306: Drupal Usability Meeting 2025-04-11. That issue will have a link to a recording of the meeting. We were primarily discussing the related issue #29338: Hide Promoted/Sticky fields by default in Form display.

We agree that this is a good idea. Thanks for working on this issue!

For the record, the attendees at the usability meeting were benjifisher, rkoller, and simohell.

poker10’s picture

Status: Reviewed & tested by the community » Needs review

There is still one @todo in the MR - do we need to discuss that? I do not see it mentioned anywhere in this issue. Thanks!

smustgrave’s picture

Status: Needs review » Needs work

Yea I think we probably do need to batch it. Know it's not likely but I have worked with sites that had 100s of content types

mohit_aghera made their first commit to this issue’s fork.

mohit_aghera’s picture

Status: Needs work » Needs review

Updated code to use the config updater service.
There were unrelated functional javascript test failures. Triggered the job again.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Believe that was the last outstanding question.

xmacinfo’s picture

Thank you everyone!

Can we do a clean-up of the Issue tags? I think some of the tags are not relevant anymore.

benjifisher’s picture

The CI tests passed, but just because the "Validatable config" test is allowed to fail.

TL;DR: I think it is worth looking at that test, but I think it is OK for it to fail for this issue.

I am not familiar with that test, but it seems to compare the results of

vendor/bin/drush config:inspect --statistics

on the target branch (11.x) and on the feature branch.

On the target branch, the installs drush and the config_inspector module. Then it installs the Standard profile and enables all core modules (except sdc, which is obsolete) and config_inspector. On the feature branch, the test first applies database updates.

The test fails if any of the statistics are lower on the feature branch than they are on the target branch.

I went through similar steps, but instead of vendor/bin/drush config:inspect --statistics, I exported configuration. The only difference between the two branches is that the feature branch includes core.base_field_override.node.article.promote.yml. It looks as though this config entity is not fully validatable: the schema is in core/config/schema/core.data_types.schema.yml, and it is not marked as FullyValidatable: ~. So it makes sense that the statistics go down and the test fails.

acbramley’s picture

Re #225 yes this is expected since we're adding new config.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new6.98 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Rebased

acbramley’s picture

Rebased again and fixed the performance tests.

xjm’s picture

Saving mentor credits as per #33.

xjm’s picture

I updated the issue credit, removing credit for a number of old rerolls where the contributor did not add anything else to the issue. I left credit for a couple people who were doing the reroll in the context of a mentored event as their first contribution. I also added credits for a number of reviewers.

I'm not able do do the review myself at the moment, but at least having the crediting in order should save some time.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

dcam’s picture

Status: Needs work » Reviewed & tested by the community

Rebased. Restoring RTBC.

longwave’s picture

Status: Reviewed & tested by the community » Needs review

Overall this looks good but I think we can remove these overrides now?

core/profiles/demo_umami/config/install/core.base_field_override.node.page.promote.yml
core/profiles/standard/config/install/core.base_field_override.node.page.promote.yml
core/recipes/page_content_type/config/core.base_field_override.node.page.promote.yml

These seem to exist to set the promote default for these content types to false - but it's now false by default, so we shouldn't need to ship them any more?

Also I'm intrigued why the Umami performance stats have such an improvement; I don't see why just flipping the default results in so many fewer queries?

acbramley’s picture

These seem to exist to set the promote default for these content types to false - but it's now false by default, so we shouldn't need to ship them any more?

Good catch, I've removed them.

Also I'm intrigued why the Umami performance stats have such an improvement; I don't see why just flipping the default results in so many fewer queries?

I would assume it's something to do with the base_field_overrides not being needed anymore since they match the default, I can try to dig into it further if needed.

acbramley’s picture

I don't really understand these performance tests tbh, OpenTelemetryNodePagePerformanceTest was giving 450 query count on cold cache, it was passing locally then it jumped back up to 457 in CI, so I changed it locally and it still passed. I'm not even sure what I changed.

godotislate’s picture

One tiny comment on the MR.

acbramley’s picture

Crediting @godotislate and @mstrelan for helping figure out the query count discrepancy.

Because we reversed the default, Demo Umami needed base field overrides for article and recipe content types. Without this, one of the articles had dropped off the homepage (I guess we have no tests for the actual content displayed on the umami homepage). This is what dropped the query count so drastically.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Feedback appears to be addressed

xjm’s picture

#239 explained the diff weirdnesses with Umami config that were making me scratch my head, thanks!

xjm’s picture

Saving reviewer credit for @longwave. Also looks like I had missed @smustgrave's changes and nontrivial rebase back in May so saving credit for that too.

  • longwave committed 6bfec5bc on 11.x
    Issue #987238 by acbramley, jenlampton, ajalan065, idebr, nsuit, dcam,...

longwave’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +11.3.0 release notes

@acbramley thanks for the explanation, it did feel like the Umami change was too good to be true here, and it turns out that was correct; glad we did not break that - and technically it is tested here indirectly, because we spotted it via the performance tests!

So, after 14 years and 240 comments by many contributors, I am happy to finally be committing what is really a one line change:

--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -357,7 +357,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setLabel(t('Promoted to front page'))
       ->setRevisionable(TRUE)
       ->setTranslatable(TRUE)
-      ->setDefaultValue(TRUE)
+      ->setDefaultValue(FALSE)

One small step towards (possibly) removing this feature in the future!

Committed 6bfec5b and pushed to 11.x. Thanks!

Also finalised and published the change record.

  • longwave committed e2180650 on 11.x
    Issue #987238 followup by xjm: "Promoted to front page" for new content...
longwave’s picture

Managed to crosspost with @xjm while we were both reviewing, committed her comment improvement as a followup.

xjm’s picture

Also a potential highlights thing, especially if we end up with other site builder UX tweaks.

acbramley’s picture

Great to finally get this in, thanks both.

Status: Fixed » Closed (fixed)

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