Follow up to #2407489: Remove user.pages.inc.

user.pages.inc was removed, but this is still referenced in the docblock for hook_theme_registry_alter(). Suggest giving another example which has a separate file with theme functions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Yeah, probably it would be better to find an implementation of hook_theme() from another module and replace it with that example. Or better yet, make a dummy implementation of the hook, and use a debugger to look at the value you get, and take an array element from that and put it into the documentation.

wadmiraal’s picture

Assigned: Unassigned » wadmiraal

I'll have a look at it.

wadmiraal’s picture

Status: Active » Needs review
FileSize
1.27 KB

Actually, the array structure is quite different. Block Content has a nice example we can use:

$theme_registry['block_content_add_list'] = array (
  'template' => 'block-content-add-list',
  'path' => 'core/themes/seven/templates',
  'type' => 'theme_engine',
  'theme path' => 'core/themes/seven',
  'includes' => array (
    0 => 'core/modules/block_content/block_content.pages.inc',
  ),
  'variables' => array (
    'content' => NULL,
  ),
  'preprocess functions' => array (
    0 => 'template_preprocess',
    1 => 'template_preprocess_block_content_add_list',
    2 => 'contextual_preprocess',
    3 => 'seven_preprocess_block_content_add_list',
  ),
);

Updated docblock in patch.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Looks good to me.

kim.pepper’s picture

While there are a number of new attributes, there is no example of using the 'file' attribute, which was the reason for the original issue.

wadmiraal’s picture

As far as I can see, there is no file attribute. It was renamed includes, it seems. At least, that's what a var_dump in hook_theme_registry_alter() tells us. In hook_theme(), it is called file, though:

function block_content_theme($existing, $type, $theme, $path) {
  return array(
    'block_content_add_list' => array(
      'variables' => array('content' => NULL),
      'file' => 'block_content.pages.inc',
    ),
  );
}

  • alexpott committed 7d80c96 on 8.0.x
    Issue #2408265 by wadmiraal: Update hook_theme_registry_alter to not...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Docs are not frozen in beta. Committed 7d80c96 and pushed to 8.0.x. Thanks!

Status: Fixed » Closed (fixed)

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