Commit e77beba5 authored by Dries's avatar Dries

- Patch #113614 by John Morahan: small fix for token/placeholder substitution to core.

parent 26024e03
......@@ -72,10 +72,6 @@ function hook_block_list() {
/**
* Configuration form for the block.
*
* Any module can export a block (or blocks) to be displayed by defining
* the _block hook. This hook is called by theme.inc to display a block,
* and also by block.module to procure the list of available blocks.
*
* @param $delta
* Which block to return. This is a descriptive string used to identify
* blocks within each module and also within the theme system.
......@@ -84,9 +80,6 @@ function hook_block_list() {
* @return
* Optionally return the configuration form.
*
* After completing your blocks, do not forget to enable them in the
* block admin menu.
*
* For a detailed usage example, see block_example.module.
*/
function hook_block_configure($delta = '') {
......@@ -104,10 +97,6 @@ function hook_block_configure($delta = '') {
/**
* Save the configuration options.
*
* Any module can export a block (or blocks) to be displayed by defining
* the _block hook. This hook is called by theme.inc to display a block,
* and also by block.module to procure the list of available blocks.
*
* @param $delta
* Which block to save the settings for. This is a descriptive string used
* to identify blocks within each module and also within the theme system.
......@@ -116,9 +105,6 @@ function hook_block_configure($delta = '') {
* @param $edit
* The submitted form data from the configuration form.
*
* After completing your blocks, do not forget to enable them in the
* block admin menu.
*
* For a detailed usage example, see block_example.module.
*/
function hook_block_save($delta = '', $edit = array()) {
......@@ -130,10 +116,6 @@ function hook_block_save($delta = '', $edit = array()) {
/**
* Process the block when enabled in a region in order to view its contents.
*
* Any module can export a block (or blocks) to be displayed by defining
* the _block hook. This hook is called by theme.inc to display a block,
* and also by block.module to procure the list of available blocks.
*
* @param $delta
* Which block to return. This is a descriptive string used to identify
* blocks within each module and also within the theme system.
......@@ -148,9 +130,6 @@ function hook_block_save($delta = '', $edit = array()) {
* content you want to display to your users. If the "content" element is empty,
* no block will be displayed even if "subject" is present.
*
* After completing your blocks, do not forget to enable them in the
* block admin menu.
*
* For a detailed usage example, see block_example.module.
*/
function hook_block_view($delta = '') {
......
......@@ -184,7 +184,6 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
$replacements[$original] = format_date($node->changed, 'medium', '', NULL, $language_code);
break;
}
dsm('node');
}
if ($author_tokens = token_find_with_prefix($tokens, 'author')) {
......
......@@ -1237,13 +1237,11 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
// token, [node:title].
$this->assertFalse(strcmp($target, $result), t('Basic placeholder tokens replaced.'));
$raw_tokens = array(
'node' => array('title' => '[node:title]'),
);
$generated = token_generate($raw_tokens, array('node' => $node));
$raw_tokens = array('title' => '[node:title]');
$generated = token_generate('node', $raw_tokens, array('node' => $node));
$this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title)), t('Token sanitized.'));
$generated = token_generate($raw_tokens, array('node' => $node), array('sanitize' => FALSE));
$generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE));
$this->assertFalse(strcmp($generated['[node:title]'], $node->title), t('Unsanitized token generated properly.'));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment