Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
enabled metatag module, & goto add content page it shows below error..
The Page title is using the following invalid tokens: [node:title], [site:name].
The Description is using the following invalid tokens: [node:summary].
The Canonical URL is using the following invalid tokens: [current-page:url:absolute].
The Shortlink URL is using the following invalid tokens: [current-page:url:unaliased].
thanks in advance,
Comment | File | Size | Author |
---|---|---|---|
#41 | 111.jpg | 527.27 KB | Mykola Dolynskyi |
#37 | 111.jpg | 688.17 KB | Mykola Dolynskyi |
#34 | 111.jpg | 374.14 KB | Mykola Dolynskyi |
#29 | 111.jpg | 420.83 KB | Mykola Dolynskyi |
#28 | 111.jpg | 137.49 KB | Mykola Dolynskyi |
Comments
Comment #1
DamienMcKennaHad you used a previous version? Do you have the latest Token module?
Comment #2
Nikhil Banait CreditAttribution: Nikhil Banait commentedRun cron manually and clear the performance cache.
Comment #3
swishstar CreditAttribution: swishstar commentedI had a similar issue. However, I had "another error" that was happening prior to my save and once I cleared that up, then this one went away. So be sure to clear all errors that appear on "other pages" first. In my case, I had a pass-by-reference that Drupal didn't like that probably didn't allow the Token module to load properly.
Comment #4
DamienMcKennaNeed more details.
Comment #5
crutch CreditAttribution: crutch commentedI experienced this error after completing upgrade d6>d7. Flushed cache and all that.
Default is still not accepting tokens. If when you manually enter something in Default, like the site name, then the page saves and tokens are able to be used for all the other fields.
I'm just beginning reconfig of site and theme. If using admin toolbar, just begin running through the list of items under the "Configuration" menu item and when reaching Page Title, is when the issue happens.
Comment #6
BenWrighton CreditAttribution: BenWrighton commented#2 worked for me on D7.
Comment #7
EgbertB CreditAttribution: EgbertB commented#2 also worked for me in d.7.22
Comment #8
chaz1975 CreditAttribution: chaz1975 commentedI tried running Cron followed by clearing cache but that didn't work.
In the end I reloaded the same version of the Token module and that seemed to do the trick.
I'm using Drush so the command is drush dl token-[version].
Comment #9
david_garcia CreditAttribution: david_garcia commentedThis problem happens if the token_info cache gets corrupted or is incomplete, in those cases even some token provided by core are not loaded.
I am trying to isolate a reproducible case in which this happens consistently, because a core cache get corrupted first (hook_info) preventing modules exposing tokens in module.tokens.inc files to have their tokens recognized (including core tokens exposed by the system or the node module) this ultimately leads to the failure in the original report.
#2457269: Incomplete hook_info cached if there's an error/warning during module_load_all
Comment #10
askibinski CreditAttribution: askibinski commentedSo this suddenly appeared on a site to me too... Running cron and flushing all caches (also manually) does not help.
- Drupal core 7.35
- Token 1.4
- Metatags 1.4
I guess I can try to upgrade token to 1.6.
Comment #11
askibinski CreditAttribution: askibinski commentedUpgrading to token 1.6 and a drush rr did seem to fix it in this case.
Comment #12
brooke_heaton CreditAttribution: brooke_heaton as a volunteer commented#11 worked for me.
Comment #13
DamienMcKennaMetatag currently requires Token module v1.6, so I think this should be a-ok now.
Comment #15
numbtongue CreditAttribution: numbtongue commentedNot sure of the side effects but for my case I was able to fix it by disabling metatag for node->Content type on this page yourdomain.com/admin/config/search/metatags
Comment #16
parvind87 CreditAttribution: parvind87 commentedRunning cron and subsequently clearing the cache fixes the problem
I am using drush so following commands need to run -
drush cron
drush cache-clear all
Comment #17
semitruckrepair CreditAttribution: semitruckrepair commentedI try everything you guys recommended above but i still can't post i'm getting this error code
The hreflang value for English (English) is using the following invalid tokens: [node:url-en].
any help what i should do this is new site just start the development and i'm stuck
other provlem feed importer module it want let me see the choose file button
any suggestion help will be great thanks
Comment #18
DamienMcKenna@semitruckrepair: Please create a new issue and I'll be happy to look into it with you. Thanks.
Comment #19
Samba B CreditAttribution: Samba B as a volunteer commented#2 worked for me. Thanks!! I have been replacing the metatag.tokens.inc to resolve this. Thanks again for making me realize that I am doing wrong.
Comment #20
leisurman CreditAttribution: leisurman commentedFor me I get
The Block title is using the following invalid tokens: [node:field-sidebar-title].
I am using token 7.x-1.6
Media7.x-1.5
File entity 7.x-1.5
When I run cron I get error
EntityMalformedException: Missing bundle property on entity of type node. in [error]
entity_extract_ids() (line 7880 of /var/www/html/upgrade2a/includes/common.inc).
There is Schema mismatch in my file_entity table
Comment #21
JaseerKinangattil CreditAttribution: JaseerKinangattil commentedGuys
I just disabled Metatag: hreflang (metatag_hreflang) module and issue resolved.
Dont forget to clear the cache and run cron
Comment #22
prabhjotg CreditAttribution: prabhjotg commented#2 worked for me.
Comment #23
Mykola DolynskyiMetatag 7.x-1.20 + Core 7.50 - clearing chache dont help, problem remains
Comment #24
DamienMcKenna@Mykola: Make sure you have the latest release of Token, otherwise please explain which token it is complaining about.
Comment #25
Mykola Dolynskyi@DamienMcKenna it complains on site:name, node:title, current-page:pager, node:summary
Tokens are 1.6, updating to 1.7 now
Comment #26
DamienMcKenna@Mykola: What form are you entering those tokens - a node form, a metatag settings form?
Comment #27
Mykola Dolynskyi@DamienMcKenna updated.
Cleared cache, flushed caches , runned cron ... no luck
Comment #28
Mykola Dolynskyi@DamienMcKenna
node form, populated automatically from somewhere
I never was entering values for metadata
Comment #29
Mykola DolynskyiHere is how Metatag config page looks like
Unknown, Unknown, Unknown everywhere about type
Remark says "Any items marked "Unknown" are configurations in the system for entity types or bundles which have been disabled via the API or the Settings page; they will not be used."
But they are enabled.
When try to add new default metatag in config form type list select dropdown is empty (only has "Select type") value ( /admin/config/search/metatags/config/add link )
Comment #30
Mykola DolynskyiClearing the cahce directly from Metatag Cfg page ( admin/config/search/metatags ) - helped
But i think it is not for long. This thing started to come from Saturnday and managed this it with weired combinations which i dont remember, it was 2 times. Now it is third time
Sure i have checked reports - nothing suspective there
Comment #31
DamienMcKenna@Mykola: There's something else interfering with the module, which is why it isn't working properly, you can tell this by the fact on the defaults page it says "Unknown" instead of the entity labels.
What does your settings page look like?
Comment #32
Mykola Dolynskyi@Damien admin/config/search/metatags/settings page is too big for single screenshot.
As i said clearing the cache directly from admin/config/search/metatags/page - is only way to resurect proper work.
I never changed anything in metatags for 1.5 years, didnot updated anything for few months - this problem just raised without any visible reason.
If I clean cache from anywhere - the problem is back.
If from module cfg page - it is gone (works again).
I will debug/investigate how it happens later - have to move other tasks now.
My suggestion - some bad thing in Entity API happens
Comment #33
DamienMcKenna@Mykola: The main thing I'm wondering about on the settings page is the "Master control for all entities" section, what does that look like?
Comment #34
Mykola Dolynskyii warned you - it is big :)
Comment #35
DamienMcKenna@Mykola: Do you see any errors when you clear the site's caches? #2457269: Incomplete hook_info cached if there's an error/warning during module_load_all might be related.
Comment #36
Mykola Dolynskyi@Damien no, no erros in drupal_set_message() no errors in watchdog (in watchdog are, but they are about my modules about forms)
I stated digging - metatag config is loaded with ctools_export_crud_load_all (in metatag_config_overview())
But where damn they are saved?
metatag_config_save() is used in form for manual adding and few addons which is not related to what i expected to find.
I expect code something like when you clear cache - there entities are iterated, tokens resolved and saved to metatag config. metatag_config_save() dont lead me to anything like this. I will try to find by something like drupal_write_record(...) - if i will find nothing i will try to update Drupal core to latest (current 7.50)
Thanks for link about Bootstrap invoking order, will check this also.
Comment #37
Mykola Dolynskyidont know if this realted to problem, but ...
updated core, checking results
UPD: after core updated to 7.54 - problem remains
Comment #38
Mykola Dolynskyiand Rules module started to fail out with
Fatal error: Call to undefined function entity_token_tokens() in /var/www/extranet/sites/all/modules/rules/rules.module on line 1670
Rules issue solved this way
Comment #39
DamienMcKennaOh wow, that screenshot shows that the system tokens are unavailable system-wide, something is really messed up with your system!
Can you please give me a list of the hooks you're using in your custom modules, maybe one of them is doing something it shouldn't be? Also, a list of the contrib modules you're using would help, I'll download them all locally so I can review them too.
Comment #40
Mykola Dolynskyi@DamienMcKenna i have > 20 000 lines in total of custom modules (client has some documentory workflow with drupal)
They are not spagetti code but to much.
What makes me confused - this all started suddenly, not after update or some "controller-close" changes, was working for months with no problems.
What i do with tokens is for example custom solver function which i call directly in custom content type save handler (hook_node_save())
call (from appraisal_v2_node_save())
Comment #41
Mykola Dolynskyiif i do kint(token_info()) on site with problems i have very few tokens
if on site which works file - plenty of tokens, for each field, for title, author ... everything
Comment #42
Mykola Dolynskyidpm(module_implements('token_info_alter'));
comparing to site which is ok site with problems such module implementation if hook_token_info_alter ae missing: entity_token, field_collection, file_entity ...
Comment #43
Mykola DolynskyiReinstalling token and entity_token modules helped (used Devel tool /devel/reinstall)
Sorry for bothering, this was not related to metatag module, but may be this all posts will help somebody, who knows.
Happy end :)
Comment #44
smaiau CreditAttribution: smaiau commentedHey Mykola,
I have the same issue for my website, reinstalling token and entity_token resolved the problem for you ?
Thanks for your reply,
Comment #45
deanw CreditAttribution: deanw commentedAfter upgrading metatag, token, entity, addressfield tokens, & file entity with no success I tried #43 which fixed the issue momentarily. Finally I upgraded pathauto and the issue now seems to be gone for good.
Comment #46
sol358 CreditAttribution: sol358 commentedHello.
I have version 7 of drupal, and when updating to php 7, he gave me these errors in the token module.
Same problem:
Token types are not defined but have tokens:
$info['types']['node']
$info['types']['term']
$info['types']['vocabulary']
$info['types']['file']
$info['types']['user']
$info['types']['current-user']
Tokens or token types missing name property:
$info['types']['date']
$info['tokens']['node']['url']
$info['tokens']['file']['size']
$info['tokens']['user']['url']
$info['tokens']['date']['custom']
Help me, please.
Thanks
Comment #47
sol358 CreditAttribution: sol358 commentedHello.
I have version 7 of drupal, and when updating to php 7, he gave me these errors in the token module.
Same problem:
Token types are not defined but have tokens:
$info['types']['node']
$info['types']['term']
$info['types']['vocabulary']
$info['types']['file']
$info['types']['user']
$info['types']['current-user']
Tokens or token types missing name property:
$info['types']['date']
$info['tokens']['node']['url']
$info['tokens']['file']['size']
$info['tokens']['user']['url']
$info['tokens']['date']['custom']
Help me, please.
Thanks.
Comment #48
DamienMcKenna@sol358: Please make sure all of the modules on your site are fully updated, see if that solves the problem.
Comment #49
sol358 CreditAttribution: sol358 commentedUpdate the metatag, opengraph and token modules but it still fails.
With php 5.6 if it works but with php 7.0 I get those errors.
Thanks for your help.
Comment #50
sol358 CreditAttribution: sol358 commentedif in php.ini I put:
zend_extension ="c:/wamp64/bin/php/php7.0.10/ext/php_opcache.dll"
;opcache.enable=0
The token is shown but it gives me several errors, like:
and many more.
If I remove commented the line zend_extension ="c:/wamp64/bin/php/php7.0.10/ext/php_opcache.dll" does not give error but token fails.
Why does this happen? Is there any solution to make it work?
Help me, please.
Thanks.
Comment #51
DamienMcKenna@sol358: It looks like the services_json module has some out-of-date code that need fixing, check with that that module's issue queue for details.
In general, though, you shouldn't be disabling opcache.
In order to track down the problem with your sites, make sure that errors are being displayed and that PHP's error reporting is set to display all errors, there's likely going to be custom code or a contrib module that's breaking something.
Comment #52
sol358 CreditAttribution: sol358 commentedSorry, but I do not know what the contrib module you are talking about is.
By adding the line zend_extension = "c: /wamp64/bin/php/php7.0.10/ext/php_opcache.dll" and correcting the errors it indicated, the token already works. My question is if this would be correct ?, that is, if it would be well done like that.
Although in some pages with the php7.0 version of wampserver do not load and yet with php5.6 if they load.
Thanks.
Comment #53
deanw CreditAttribution: deanw commentedI had thought #43 had fixed the issue but clearing cache caused the error to resurface as noted here -
https://www.drupal.org/project/token/issues/1265848#comment-11424803
After updating to php 7.1 from 7.0, clearing cache no longer causes the issue to reappear.
Comment #54
sol358 CreditAttribution: sol358 commentedHello,
With PHP7.0.10 in wampserver it works on almost every page but in some it does not load me. However with PHP5.6.25 in wampserver I load all.
Nose if the problem is php.ini or is it fails in something else. I tried to put php7.1.3 in the wampserver but I have not got it, so I have not been able to test if it works or not.
Any idea why it fails?
Thank you.
Comment #55
loze CreditAttribution: loze commentedI am getting this error with content tokens that are defined in a feature. Reverting the field bases in my feature makes the tokens available, but then a few hours later they are no longer there. (but the fields still are)
Comment #56
narquam CreditAttribution: narquam commentedI've been seeing this issue on one multisite specifically but not my others. The site with the issue has a lot of other modules that use tokens enabled including a lot of commerce modules. I haven't been able to trace the cause but this issue pops up randomly and stays until I clear all cache. Clearing just token cache does not resolve the issue. Clearing cache only temporarily fixes the problem though. We're running PHP 7.1 and I've tested other versions so I'm not sure this has anything to do with PHP version. I did enough digging to find the tokens aren't defined in cache when this happens and they aren't being repopulated so Drupal isn't finding them. None of the fixes listed have worked except the temporary cache clearing fix.
Is it possible that this is caused by the size of cache being too large or is it possible the cache is somehow getting corrupted? Drupal still thinks it's valid in cache from what I can tell, at least it appears Drupal doesn't think it needs to regenerate the tokens. We're also storing our cache in memcache, which is why I'm wondering if the cache size is part of the problem.
Comment #57
omkarms CreditAttribution: omkarms as a volunteer and commentedAfter running CRON, it worked for me.
Comment #58
yntun CreditAttribution: yntun commentedEnable the error log and check if there is any warning from custom modules implemented. In our case, one of the warnings has caused the missing token issue whenever we enable/disable modules or even at running drush cc all. After we fixed this warnings, token issue doesn't come back again.
Comment #59
pamelalies CreditAttribution: pamelalies commentedI was trying to track down this issue with disappearing tokens (and metatags) for a couple of months, and I finally found the solution for our sites! I thought I would post it here in case anyone else might have the same root cause - because it wasn't an easy one to track down.
This issue broke all site tokens, so it was messing up lots of things - anywhere tokens were used on the sites. It was causing blank webform submission emails to be sent (because the data is fed into the emails via tokens), and several other nasty things.
I know a lot of people mentioned that it started happening after upgrading PHP to 7. In our case the problem was caused by the Colorfield module, which has some of the "curly braces" code, which is deprecated in PHP 7.4.
I applied this patch to our installed Colorfield module, and it fixed this issue that's been plaguing us.
https://www.drupal.org/project/colorfield/issues/3163653
You wouldn't think that a module throwing a warning would break so many other things, but in this case it did. If this isn't your exact problem, you might try fixing any other curly braces deprecations in any other modules you might have installed and see if it helps you as it did us.
I'm posting this solution everywhere I see people talking about this issue (which is a lot of posts on Drupal.org!) to help as many fellow developers as possible...hope it helps!