Missing tokens

Minor annoyance as i like to keep my status report green :)

//Josef

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jgullstr’s picture

Assigned: jgullstr » Unassigned
Status: Active » Needs review
FileSize
554 bytes

Patch

Xano’s picture

Status: Needs review » Closed (won't fix)

Thanks for the patch, but as was mentioned in the several issues before, descriptions must never be required, so we're getting this fixed in core instead: #1911768: Make token and token type descriptions optional. If you are keen on fixing this problem, I would be thankful if you were to review the patch there.

Kebz’s picture

Status: Closed (won't fix) » Fixed
Issue tags: +currency, +manual patch, +missing token description

POSTED & EDITED BY: Kebz | 08DEC2014

YAY!! My first time applying a patch... LOL

I've been a drupalgrammer for over a decade and I change/edit codes and themes quite frequently.... but I've never had to apply a patch.
I'm providing a "before & after" sample below to hopefully help others to understand it better. This worked for me and I now have a "green" status report... yay!!

This sample below is a MANUAL PATCH for this CURRENCY / TOKEN issue (in reference to this link > https://www.drupal.org/node/2234015 in discussion)

BEFORE: starting @ line 33, with 10 lines of code (re: -33,10)
starting @ line 33, remove the following code that equals to 10 lines total

33 'type' => 'text',
34 );
35 $tokens['currency']['sign'] = array(
36 'name' => t('Sign'),
37 'type' => 'text',
38 );
39 $tokens['currency']['title'] = array(
40 'name' => t('Name'),
41 'type' => 'text',
42 );

AFTER: starting @ line 33, with 12 lines of code (re: +33,12)
starting @ line 33, paste the following code that equals to 12 lines total

33 'type' => 'text',
34 );
35 $tokens['currency']['sign'] = array(
36 'description' => t('The sign of the currency.'),
37 'name' => t('Sign'),
38 'type' => 'text',
39 );
40 $tokens['currency']['title'] = array(
41 'description' => t('The name of the currency.'),
42 'name' => t('Name'),
43 'type' => 'text',
44 );

The actual patch file (https://www.drupal.org/files/issues/currency-missing-token-descriptions-...) reads as follows: (Be sure to remove the "+" sign before saving and uploading back up into the server.... and ALWAYS make a copy FIRST before making any changes to any files you tinker with. :) )

diff --git a/currency/currency.tokens.inc b/currency/currency.tokens.inc
index 4587a87..0ac2964 100644
--- a/currency/currency.tokens.inc
+++ b/currency/currency.tokens.inc
@@ -33,10 +33,12 @@ function currency_token_info() {
'type' => 'text',
);
$tokens['currency']['sign'] = array(
+ 'description' => t('The sign of the currency.'),
'name' => t('Sign'),
'type' => 'text',
);
$tokens['currency']['title'] = array(
+ 'description' => t('The name of the currency.'),
'name' => t('Name'),
'type' => 'text',
);

For more information about applying a patch "manually"... click on this link > https://www.drupal.org/node/534548#comment-9415547

Xano’s picture

Status: Fixed » Closed (fixed)
Issue tags: -currency, -manual patch, -missing token description

Welcome to the issue queue! First things first:
- Please read Status settings of issues to understand how issue statuses work.
- Please do not add random tags to issues. If you don't know which tags to add, then just don't add any at all.
- Read the handbook page about applying patches.

As I have said before: this is a design flaw in Drupal core and these reports are just notifications. Nothing bad will happen without the patch.