I'm not sure this is really a bug, since when the module is enabled the content type does appear. However, if one looks at blog.install and forum.install one will see:

  // Ensure the blog node type is available.
  node_types_rebuild();
  $types = node_type_get_types();

inside one of the functions.

Comments

vegantriathlete’s picture

Status:Needs work» Active

Sorry, I guess I should have left the status as active.

GoZ’s picture

I think there is no need to check that poll node type exists.

In blog and forum, this code permit to attach body field instance to their own content type. Since poll does not use existing fields, there is no need to call

node_types_rebuild();
$types = node_type_get_types();
greggles’s picture

Project:Drupal core» Poll (from core)
Version:7.x-dev» 8.x-1.x-dev
Component:poll.module» Code
typhonius’s picture

Poll by default doesn't have a body field. if the default poll content type were to have a body field then something like

<?php
  node_types_rebuild
();
 
$types = node_type_get_types();
 
node_add_body_field($types['poll']);
?>

would be feasible to use.

Should the question therefore be: Should poll have a body field?

typhonius’s picture

typhonius’s picture

Issue summary:View changes
Status:Active» Postponed

Poll in 8.x won't be reliant on node since it's its own entity. This one may be ripe for moving back to Core > Poll in the future.

typhonius’s picture

Project:Poll (from core)» Drupal core
Version:8.x-1.x-dev» 7.x-dev
Component:Code» poll.module

Moving back to 7.x Core -> Poll as the 8.x poll module doesn't have a dependency on the node system.

dcam’s picture

Status:Postponed» Active