-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity Tokens throws warning if comments not enable #32
Comments
Hi @e0Re0R . Thanks for reporting. This warning is thrown by Backdrop core when a token type is not defined. The module Let me know also if you are using version 2.0.1 of Entity Token. |
Hi again. The title of this issue is confusing. You say there that comments is not enabled, but the text of the issue seems to indicate that it is enabled. Can you please clarify? |
OK, I think I understand now - I have been able to reproduce this error by disabling and uninstalling comment. I'll check why this is happening very soon. |
Hi again. I have fixed that issue. You have a couple of choices
// Tokens for type comment.
if (module_exists('comment')) {
$info['tokens']['comment']['subject'] = array(
'name' => 'Subject',
'description' => t('The subject of the comment.'),
'entity-token' => TRUE,
);
$info['tokens']['comment']['status'] = array(
'name' => 'Status',
'description' => t('Whether the comment is published or unpublished.'),
'entity-token' => TRUE,
);
$info['tokens']['comment']['comment_body'] = array(
'name' => 'Comment',
'description' => t('Field "comment_body". The following properties may be appended to the token: value (Text), format (Text format)'),
'entity-token' => TRUE,
);
}
This warning will not cause any issues, though. Thanks again for reporting!!! |
Issue #32. Check if comment is enabled
…have properties Fixes backdrop-contrib#32.
Issue #32. Skip creation of tokens if entity doesn't have properties
Hi,
my site does not have comments enabled.
Installing (& enabling) Entity Tokens throws a warning in the status report -
"The following token types are not defined but have tokens:
$info['types']['comment']"
This only appears if comments and Entity Tokens is are both enabled.
Its not killing my site or anything, more just an FYI
N
The text was updated successfully, but these errors were encountered: