I ran into something today that, even as an experienced Drupal developer, I was completely thrown off by. Consider the following:

  • User installs Drupal using the "Minimal" installation profile (to which no content types are added)
  • After clicking around a bit, they go to "Add Content" via node/add
  • No content types are displayed (obviously) but no warning message exists to prompt users and thus it appears "broken"

With the Overlay module enabled, it's especially heinous as it looks like the attached image (http://drupal.org/files/add-new-content-d7.jpg). This actually caused me to fumble around for a minute or two until I stumbled back on the "Content Types" screen where it notifies me that none are available.

I think this is partially because in Drupal 6, the absence of Minimal created content types for you.

Does it make sense for us to include some text to that effect on node/add when no content types have been created? e.g. "No content types available. Add content type."

Probably better for us to present that message than include a default content type since that would defeat the purpose of Minimal.

Comments

webkenny’s picture

Sorry, folks my inline link above is broken. Should be: http://drupal.org/files/issues/add-new-content-d7.jpg

reglogge’s picture

Component: user interface text » Seven theme
StatusFileSize
new914 bytes

This is actually a problem with seven theme which overrides theme_node_add_list() from node_pages.inc where the correct code for displaying the desired warning message is implemented. In Seven's override-function the check for if (count($content) == 0) has been ommitted.

Patch attached.

reglogge’s picture

Status: Active » Needs review

pinging bot.

reglogge’s picture

StatusFileSize
new38.66 KB

An even simpler solution would be to just remove the function seven_node_add_list() from template.php in seven theme. The screen for selecting the content-type would then look like the attached screenshot.

The default warning message for no existing content-types would then be displayed also.

Jeff Burnz’s picture

Confirmed - the patch in #4 fixes the issue.

Prefer to go with the patch and not require us to fix the visual style of Seven since it's quite important we maintain this.

+1

bojanz’s picture

Status: Needs review » Needs work

The fix is cool.

One nitpick: coding style.

} else {

Should be

}
else {

Do a quick reroll, and this is RTBC.

reglogge’s picture

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

rerolled according to #8.

bojanz’s picture

Okay.

webkenny’s picture

Status: Needs review » Reviewed & tested by the community

Works for me as well. Thanks.

reglogge’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Closed as duplicate of #852394: minimal profile + seven leads to broken 'node/add' link which is more elegant.