Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 302749

node_help() broken for node add/edit form

$
0
0

Problem/Motivation

node_help() does this:

<?php
$type
= $node->getType();
return (!empty(
$type->help) ? Xss::filterAdmin($type->help) : '');
?>

$node->getType() returns the name of the node type, as a string. The next line assumes $type is a NodeType object. As a result, no help text is displayed.

Note that the default node types (article and page) don't have any help text by default, so to make the problem visible you have to add one (on admin/structure/types/manage/article)

Proposed resolution

Do NodeType::load($type) or so.

Also, does it make sense to test the presence of the help text? I cannot find any test like that in Core...

Remaining tasks

Fix and perhaps add test coverage.

User interface changes

The help text will be visible again :D

API changes

None


Viewing all articles
Browse latest Browse all 302749

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>