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.
| Comment | File | Size | Author |
|---|
Issue fork drupal-987238
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:
- 987238-promoted-to-front
changes, plain diff MR !11608
Comments
Comment #1
devin carlson commentedDrupal 7 now includes the ability to specify default publishing options using the configure content types interface.
Comment #2
David_Rothstein commentedThis 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.
Comment #3
LarsKramer commentedWell, 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.
Comment #4
jenlamptonPeople 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.
Comment #5
LarsKramer commentedFYI: There is now a contributed module that allows you to change the default content type settings:
Content Type: Extras.
Comment #6
Everett Zufelt commentedAgree with approach in #4.
Comment #7
haydeniv commentedWhile 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.
Comment #8
jenlampton@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 :)
Comment #9
jenlamptonThat first patch has extra whitespace, sorry thought I had removed it.
Comment #10
Everett Zufelt commentedbook.install:
forum.install:
You might consider removing these statements, as with your patch they are now the default for a new node type.
Comment #11
jenlamptonGood idea! :)
Aah, Less code feels good, doesn't it? even just a few lines :)
Comment #13
jenlampton#11: content_type_default_not_promoted-987238-11.patch queued for re-testing.
Comment #15
kim.pepperRe-rolled patch from #11 to fix failing book module test.
Kim
Comment #16
kim.pepperMarking needs review
Comment #17
Everett Zufelt commentedI think that this needs another review, but +1 from me.
Comment #18
jdsaward commentedAlso tested this patch, works fine!
Comment #19
David_Rothstein commentedI think this is good, but still needs some more work.
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...Comment #20
jenlampton1. 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 :)
Comment #21
Everett Zufelt commentedWe do need update functions
Example:
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.
Comment #22
haydeniv commented#20 applies clean and works as expect. No checkbox. Just need update function and good to go I think.
Comment #23
David_Rothstein commented"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.
Comment #24
devin carlson commentedMarked #1005244: Sensible default workflow options for new node types as a duplicate of this issue.
Comment #25
aLearner commentedI'll attempt to make the changes to the update function as described in Comment # 23.
Comment #26
webchickHm. 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.
Comment #27
jenlamptonI 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.
Comment #28
webchickWell 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??
Comment #29
yoroy commentedReading this I could not find an explanation of what 'the node orphanage' is supposed to mean. What does it mean? Thanks :)
Comment #30
David_Rothstein commentedI 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.
Comment #31
webchickThe 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*
Comment #32
sun@aLearner is about to come up with a freakin' patch! :)
Comment #33
aLearner commentedI'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.
Comment #34
aLearner commentedComment #35
aLearner commentedHello,
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
Comment #36
aLearner commentedApplication 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
Comment #37
aLearner commentedUpdate
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.
Comment #38
dig1 commentedHi, 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...:)
Comment #39
aLearner commentedDig1,
Thanks very much for your help. Also, thank you for confirming that 'Article' is indeed behaving not as expected.
Comment #40
yoroy commentedThanks all. Seems this needs work :)
Comment #41
David_Rothstein commentedThanks 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:
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 :)
Comment #42
aLearner commentedyoroy,
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.
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.
Comment #43
aLearner commentedOK. 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.
Comment #44
aLearner commentedHi,
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
Comment #45
David_Rothstein commentedI 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.txtComment #46
aLearner commentedDavid_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.
Comment #47
tim.plunkettThis 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?
Comment #48
Cauliflower commentedI 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.
Comment #49
Cauliflower commentedComment #51
Cauliflower commentedMmmm, 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!
Comment #52
Cauliflower commented#48: drupal8.node-type-promoted.48.patch queued for re-testing.
Comment #54
xjmComment #55
Renee S commentedIt 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...
Comment #56
langworthy commentedre-roll
Comment #58
rootwork#56: drupal8.node-type-promoted.56.patch queued for re-testing.
Comment #60
rootworkThis patch applied fine locally and on simplytest.me so I'm confused why it's failing testing here.
Comment #61
rootworkOops, sorry, switching back to needs work.
Comment #62
rootworkAh, the node update ID was wrong.
Attaching a new patch and interdiff, since it was just one character that changed.
Comment #64
disasm commentedRerolling patch.
Comment #66
vito_a commentedComment #67
vito_a commentedRe-rolling the #64.
Comment #68
vito_a commentedRe-applying a tag.
Comment #70
vito_a commented#67: drupal-node_type_promoted-987238-67.patch queued for re-testing.
Comment #72
jlbellidoI don't know why but this code makes to fail the test :
Added new patch that change update_N() and remove this change, But i think that this needs work.
Comment #73
jlbellidoComment #74
LinL commentedHere'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...
Comment #76
LinL commentedCan I just change the
AggregatorTestBase.phptest?Comment #77
LinL commentedSorry, messed up interdiff in #76. Here it is again.
Comment #79
yoroy commentedBump. (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.
Comment #80
xjm(Merging "node system" and "node.module" components for 8.x; disregard.)
Comment #82
pflame commentedI am working on rerolling this patch to latest version of 8.x.
Comment #83
pflame commentedI 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.
Comment #84
pflame commentedI am working on updating the issue summary by following the instructions at https://drupal.org/contributor-tasks/write-issue-summary
Comment #87
internetdevels commentedMay be we don't need this to be changed in tests.
Comment #90
mehuls commentedComment #91
rootworkSetting to needs review for testbot.
Comment #93
rootwork90: 987238-Promoted to front page should be false by default.patch.patch queued for re-testing.
Comment #95
izus commented90: 987238-Promoted to front page should be false by default.patch.patch queued for re-testing.
Comment #97
penyaskito90: 987238-Promoted to front page should be false by default.patch.patch queued for re-testing.
Comment #99
gnugetThis issue needs an summary update, here the instructions:
https://drupal.org/contributor-tasks/write-issue-summary
Comment #100
minneapolisdan commentedComment #101
minneapolisdan commentedComment #102
colinafoley commentedI'm working on this.
Comment #103
colinafoley commentedHere's a new patch. The path changed from
/core/modules/node/lib/Drupal/node/Entity/NodeType.phpto/core/modules/node/src/Entity/NodeType.phpComment #105
rootworkSeems like the tests will have to be updated to match — they must assume promote to front page being on.
Comment #106
ec1ipsis commentedWorking on fixing the test.
Comment #107
ec1ipsis commentedUn-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.
Comment #108
nsuit commentedI will attempt to look into the problem at the drupalcon sprint.
Comment #109
nsuit commentedFound a way to patch this. Thanks Dan!
Comment #111
nsuit commentedLast patch combined my patch with the previous one by mistake. Here is the patch again.
Comment #113
nsuit commentedTrying to see if using FALSE instead of 0 as an argument makes a difference in having this patch pass the automated tests.
Comment #115
nsuit commentedAs D8WTF! at drupalcon sprint and footwork in #105 suggested, some of the automated tests need maybe to be rewritten?
Comment #116
dcam commentedYes, 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.
Comment #117
alansaviolobo commentedComment #118
netlooker commentedI'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.
Comment #120
hussainwebI 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.
Comment #122
yesct commenteddoing 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.
Comment #123
yesct commentedComment #124
kattekrab commentedAdding related issue #2350013: Descriptions for Promotion Options are too technical
Comment #125
idebr commentedThis issue is like time travelling :)
This issue would still be nice to include in D8 I think. Patch attached.
Comment #127
idebr commentedThis should fix the remaining tests.
Comment #128
idebr commentedComment #129
jsobiecki commentedI'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();Comment #130
jain_deepak commentedRerolled
Comment #131
pawelgorski87 commentedI fixed last patch version. Patch tested with latest codebase 8.0.x branch.
Comment #134
idebr commentedUpdated the test with the changes from #2396717: Clean-up taxonomy module test members - ensure property definition and use of camelCase naming convention
Comment #135
hussainwebWhy is this changed? Is there a admin_user property on the class? This does not look related to the issue on hand either.
Comment #136
idebr commented@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.
Comment #137
rootworkHere are screenshots of the behavior--
Add new content type without patch:

Add new 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:

And Add Article with patch:

Comment #138
kattekrab commentedShould 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?
Comment #139
kattekrab commentedComment #140
alvar0hurtad0Comment #141
alvar0hurtad0Here's the reroll to the 8.1.x branch.
Comment #142
alvar0hurtad0Sorry, the status.
Comment #144
catchTagging.
Comment #145
kattekrab commentedManual 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!
Comment #146
kattekrab commentedUpdated the title to make it clear this change is for NEW content types.
Comment #147
alvar0hurtad0@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.
:)
Comment #148
kattekrab commented@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.
Comment #149
webchickTo 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.
Comment #150
kattekrab commentedOk - 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...
Comment #152
ajalan065 commentedThe patch did not apply cleanly.
So had to re-roll it.
Uploading the re-rolled patch.
Comment #153
ajalan065 commentedComment #157
ajalan065 commentedUploading the rerolled patch again for testing
Comment #158
ajalan065 commentedComment #160
rootworkGo go Drupal testbot
Comment #161
rootworkWhoops, sorry for the cross-post. Back to needs work since it didn't apply.
Comment #163
ajalan065 commentedThe patch is working fine on my local.. I am not able to get why it is failing the testings
Comment #164
gnugetIt 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.
Comment #165
ajalan065 commentedI viewed the output at the console..Its probably due to path conflict..Let's see whether this modified patch works....
Comment #169
ajalan065 commentedUploading the rerolled patch with changes..
Comment #170
ajalan065 commentedComment #172
ajalan065 commentedComment #174
yoroy commentedHere’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.
Comment #175
Trupti Bhosale commentedVerified 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.
Comment #176
Trupti Bhosale commentedComment #177
ajalan065 commentedHi Truptti,
The patch worked fine for me
Comment #178
ajalan065 commentedComment #179
ajalan065 commentedComment #181
ajalan065 commentedI applied the patch on a clean drupal install...It works... do not know why 3 tests fail..looking into it
Comment #182
naveenvalechaWe also need to update the default value in few failing testsCommentFieldsTest, ContextualDynamicContextTest, FrontPageTest
Comment #183
kattekrab commented@yoroy ++
Comment #184
vprocessor commentedComment #185
vprocessor commentedComment #186
lluvigneComment #187
lluvigneHi,
i try to fix the failing tests. Hope it works!
Comment #188
naveenvalechalooks good
Comment #189
alexpottWe 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.
Comment #190
alexpottActually given that the product manager asked for an issue summary update in #149 setting to needs work for that.
Comment #191
webchickReviewed 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.
Comment #206
acbramley commentedThis 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.
Comment #209
xmacinfoBased on #29338: Hide Promoted/Sticky fields by default in Form display, we should be marking this ticket as “Outdated” or “Duplicate”.
Comment #210
acbramley commented@xmacinfo no - this is different. This is making the checkbox on the NodeType form itself to be unchecked.
Comment #211
xmacinfoYes, but if we remove the checkboxes on new install, we do not need to worry about the checkbox being unchecked.
Comment #212
acbramley commentedComment #213
acbramley commentedCR 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
Comment #214
acbramley commentedWe 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!
Comment #215
acbramley commentedAdded a basic upgrade path, needs tests though.
Comment #216
dcam commentedI added an update path test.
Comment #217
smustgrave commentedSo 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.
Comment #218
benjifisherWe 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.
Comment #219
poker10 commentedThere is still one @todo in the MR - do we need to discuss that? I do not see it mentioned anywhere in this issue. Thanks!
Comment #220
smustgrave commentedYea 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
Comment #222
mohit_aghera commentedUpdated code to use the config updater service.
There were unrelated functional javascript test failures. Triggered the job again.
Comment #223
smustgrave commentedBelieve that was the last outstanding question.
Comment #224
xmacinfoThank you everyone!
Can we do a clean-up of the Issue tags? I think some of the tags are not relevant anymore.
Comment #225
benjifisherThe 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
on the target branch (11.x) and on the feature branch.
On the target branch, the installs
drushand theconfig_inspectormodule. Then it installs the Standard profile and enables all core modules (exceptsdc, which is obsolete) andconfig_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 includescore.base_field_override.node.article.promote.yml. It looks as though this config entity is not fully validatable: the schema is incore/config/schema/core.data_types.schema.yml, and it is not marked asFullyValidatable: ~. So it makes sense that the statistics go down and the test fails.Comment #226
acbramley commentedRe #225 yes this is expected since we're adding new config.
Comment #227
needs-review-queue-bot commentedThe 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.
Comment #228
smustgrave commentedRebased
Comment #229
acbramley commentedRebased again and fixed the performance tests.
Comment #230
xjmSaving mentor credits as per #33.
Comment #231
xjmI 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.
Comment #232
needs-review-queue-bot commentedThe 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.
Comment #233
dcam commentedRebased. Restoring RTBC.
Comment #234
longwaveOverall 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?
Comment #235
acbramley commentedGood catch, I've removed them.
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.
Comment #236
acbramley commentedI 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.
Comment #237
godotislateOne tiny comment on the MR.
Comment #239
acbramley commentedCrediting @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.
Comment #240
smustgrave commentedFeedback appears to be addressed
Comment #241
xjm#239 explained the diff weirdnesses with Umami config that were making me scratch my head, thanks!
Comment #242
xjmSaving 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.
Comment #245
longwave@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:
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.
Comment #247
longwaveManaged to crosspost with @xjm while we were both reviewing, committed her comment improvement as a followup.
Comment #248
xjmAlso a potential highlights thing, especially if we end up with other site builder UX tweaks.
Comment #249
acbramley commentedGreat to finally get this in, thanks both.