Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create placeholder content when running standard install profile #519

Closed
docwilmot opened this issue Dec 31, 2014 · 38 comments
Closed

Create placeholder content when running standard install profile #519

docwilmot opened this issue Dec 31, 2014 · 38 comments

Comments

@docwilmot
Copy link
Contributor

docwilmot commented Dec 31, 2014

Instead of the unhelpful "no content created yet" message, how about a default "Your first article" node like WP does?


PR from @docwilmot at backdrop/backdrop#1566
PR from @jenlampton at backdrop/backdrop#1578

@quicksketch
Copy link
Member

Here's the drupal.org issue: https://www.drupal.org/node/79582

The solutions proposed in that issue are all over the place: a new .inc file for profiles, creating an entirely new profile "Standard with demo content", and somehow even importing content via JSON/YML/feeds is suggested at the end.

However, the interesting thing from reading that is that most posters seem to be interested in providing default content. It's all just a matter of how that default content should be added. I think for starters, let's do exactly what you're suggesting and just provide a single sample node out-of-box in the standard.profile, describing itself as a sample and how to edit it.

@Bojhan was participating in that issue a few years ago. Perhaps he'd have some input here as well.

@quicksketch quicksketch added this to the 1.x-future milestone Dec 31, 2014
@cellear
Copy link

cellear commented Jan 1, 2015

This seems related to this issue I opened last year.

#89

@docwilmot
Copy link
Contributor Author

docwilmot commented Jan 1, 2015

Posted by nedjo on August 19, 2006 at 6:51pm

Wow. I hope we're not still discussing this 8 years from now!
I'm thinking in the default install profile a simple:

node>title="Your first article!"
node>body="This is your first article, edit it or delete it."
node>save.

Thats it. Obvious advantages over "Duh you dont have a post yet!"

@serundeputy
Copy link
Member

Does it make sense to put that in core/modules/system/system.install
something like:

function system_update_1036() {
  $node = array(

or am i way off base here?

@quicksketch
Copy link
Member

We'd probably put it in standard.install (in the Standard profile), so other profiles or distributions wouldn't need our sample node or could make their own. We can do it right after the "article" content type is created.

@quicksketch
Copy link
Member

Nice one @serundeputy. PR at backdrop/backdrop#713. We'll need to wait on this until the 1.1.x branch exists at least. In the mean time, anyone else have input? The PR does exactly what @docwilmot described.

@serundeputy
Copy link
Member

could be a 1.1 milestone? (crickets)

@quicksketch
Copy link
Member

Sure! No reason why not. I don't think this would be considered an API change.

The PR still needs a small amount of work, and should be squashed together to make a single commit.

@quicksketch quicksketch modified the milestones: 1.1.0, 1.x-future Mar 30, 2015
@serundeputy
Copy link
Member

updated and rebased
travis testing now.

@quicksketch
Copy link
Member

Thanks @serundeputy. It looks like we may have a lot of tests that assume either the default front page content or a situation where the first node created is "node ID 1" (which it won't be after this change). We can probably fix most of these tests by adding:

protected $profile = 'minimal';

At the top of some of these test classes. That will switch the installation profile from "standard" to "minimal", which doesn't include this change. The minimal install profile also contains fewer modules and runs faster anyway, so we should be using it whenever we can in tests. If switching to the minimal profile breaks more than it fixes, we'll just need to update the tests to work with the new front page node.

@serundeputy
Copy link
Member

sounds good I'll give it a go tonight.
On Mar 31, 2015 1:26 AM, "Nate Haug" [email protected] wrote:

Thanks @serundeputy https://github.com/serundeputy. It looks like we
may have a lot of tests that assume either the default front page content
or a situation where the first node created is "node ID 1" (which it won't
be after this change). We can probably fix most of these tests by adding:

protected $profile = 'minimal';

At the top of some of these test classes. That will switch the
installation profile from "standard" to "minimal", which doesn't include
this change. The minimal install profile also contains fewer modules and
runs faster anyway, so we should be using it whenever we can in tests. If
switching to the minimal profile breaks more than it fixes, we'll just need
to update the tests to work with the new front page node.


Reply to this email directly or view it on GitHub
#519 (comment)
.

@serundeputy
Copy link
Member

with

protected $profile = 'minimal';

screen shot 2015-03-31 at 8 35 48 pm

@serundeputy
Copy link
Member

if i put the same in views_glossary.test:

/**
 * Tests glossary view ( summary of arguments ).
 */
class ViewsGlossaryTestCase extends ViewsSqlTest {
  protected $profile = 'minimal';

they pass. @quicksketch what do you think?

@quicksketch
Copy link
Member

That's great. The more tests we convert to using the minimal (or even better the "testing") profile, the faster our tests will run. Any test that can be converted to use a lighter installation profile we should switch.

@serundeputy
Copy link
Member

updated
rebased
pushed
travis testing.

should we open a ticket to convert tests to 'testing' profiles; perhaps per module to make more manageable?

@serundeputy
Copy link
Member

good novice tickets to get people involved?

@quicksketch
Copy link
Member

good novice tickets to get people involved?

It depends... sometimes I feel like our "novice" issues are still pretty difficult. SimpleTest is not a very trivial tool to understand. Though once you understand the UI for it, it can be pretty straightforward. We could mark them novice if we write up a details set of instructions.

@serundeputy
Copy link
Member

travis test failed; running through tests on local updating to use minimal install profile.

@serundeputy
Copy link
Member

so it looks like tests that depend on logging in a user with administer views permissions are failing. For example views_ui.test line 18:

$views_admin = $this->backdropCreateUser(array('administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view revisions'));

@docwilmot
Copy link
Contributor Author

Should we also add this node as an entry in the Main Menu? For similar reasons, it lets the new Backdropper know that the menu exists, and leads them there if they want to learn more about menus, or to delete or modify it.

@serundeputy
Copy link
Member

sounds good to me. @quicksketch what do you think?

@quicksketch
Copy link
Member

What should the menu item say, "About" or "Example"? node/1 is usually an about page for me. It may be less frustrating for a new user to just modify the content of the node to be an about page than find the menu settings on the node form.

@docwilmot
Copy link
Contributor Author

I think the menu entry should be the node title.

@serundeputy serundeputy modified the milestones: 1.5.0, 1.4.0 May 14, 2016
@mikemccaffrey mikemccaffrey changed the title Create a "Hello World" node on install Create placeholder content when running standard install profile Jul 2, 2016
@jenlampton
Copy link
Member

No progress made on this since last release, officially bumping from 1.5 to 1.x-future.

@jenlampton jenlampton modified the milestones: 1.x-future, 1.5.0 Sep 8, 2016
@docwilmot docwilmot self-assigned this Sep 15, 2016
@docwilmot
Copy link
Contributor Author

Update to this, assigning me. I'm suggesting two default nodes:

@jenlampton jenlampton modified the milestones: 1.5.0, 1.x-future Sep 15, 2016
@jenlampton
Copy link
Member

jenlampton commented Sep 15, 2016

Reassigning to 1.5 since it looks like it's got a shot now! :)

@quicksketch
Copy link
Member

Get 'em @docwilmot!

@jenlampton
Copy link
Member

@docwilmot got it so, so very close. I've fixed the last three tests and they are testing now at backdrop/backdrop#1578

@quicksketch
Copy link
Member

Looking good! Tests are passing but there are a few issues:

  • The page node isn't added to the primary menu as a link.
  • For some reason the aliases aren't working, they use the defaults of post/first-post and page/about-page. It should be posts/first-post and about-page.
  • IMO, "About page" should be retitled to just "About", I get that we're including the content type in the title, but it seems so much more awkward for the About page (which probably won't be deleted) than it does for the first post (which probably will).

@jenlampton
Copy link
Member

jenlampton commented Sep 16, 2016

For some reason the aliases aren't working,

Looks like the nodes were created before the aliases were set. I'll move them to below.

"About page" should be retitled to just "About"

Agree, and done.

The page node isn't added to the primary menu as a link.

That's because the path wasn't matching up. Fixed up now, and testing. backdrop/backdrop#1578

@quicksketch
Copy link
Member

quicksketch commented Sep 16, 2016

backdrop/backdrop#1578 has been merged into 1.x for 1.5.0. Yay! This was our last item for release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants