Received error below when attempting to "Browse Replacement Patterns". Cannot determine if the token I'm trying to use is valid or not. Attempting to tokenize a field associated with the logged in user with the machine name of "field_user_affiliation" using the token "[current-user:user-affiliation]" in the path of a menu link.
Any thoughts? BTW I have put in a request for additional RAM to be installed in my laptop but have no idea as to when this will happen.
Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 72 bytes) in /home/quickstart/websites/bjatraining.org/sites/all/modules/token/token.pages.inc on line 71 Call Stack: 0.0073 656856 1. {main}() /home/quickstart/websites/bjatraining.org/index.php:0 0.9932 101837496 2. menu_execute_active_handler() /home/quickstart/websites/bjatraining.org/index.php:21 0.9968 102000928 3. call_user_func_array() /home/quickstart/websites/bjatraining.org/includes/menu.inc:517 0.9968 102001296 4. token_page_output_tree() /home/quickstart/websites/bjatraining.org/includes/menu.inc:0 0.9970 102003784 5. theme() /home/quickstart/websites/bjatraining.org/sites/all/modules/token/token.pages.inc:59 1.0130 104905128 6. theme_token_tree() /home/quickstart/websites/bjatraining.org/includes/theme.inc:1142 4.4404 395559400 7. drupal_render() /home/quickstart/websites/bjatraining.org/sites/all/modules/token/token.pages.inc:171 4.4404 395561680 8. theme() /home/quickstart/websites/bjatraining.org/includes/common.inc:5842 4.4406 395563064 9. theme_tree_table() /home/quickstart/websites/bjatraining.org/includes/theme.inc:1142
Comments
Comment #1
develcuy commentedIt looks like an infinite loop.
Comment #2
a.ross commentedShouldn't the token be:
[current-user:field-user-affiliation]Anyway, it could simply be a performance issue of token. There are a few issues about that already:
That said, 400MB sounds like a lot. How many and what kind of fields are you using? BTW is the site running locally on your laptop?
Comment #3
deastlack commentedFirst, thanks for the quick response.
Second, I'm finding the following error quite often:
"Notice: Use of undefined constant DEBUG_BACKTRACE_IGNORE_ARGS - assumed 'DEBUG_BACKTRACE_IGNORE_ARGS' in _menu_token_is_called_from_features() (line 186 of /home/quickstart/websites/bjatraining.org/sites/all/modules/menu_token/menu_token.module)."
Does Menu Token require a specific version of PHP or specific extensions to PHP or Apache? If so these may not be enabled or available on my local environment (built using the QuickStart Platform) but may be available on our Dev, Staging or Prod servers.
Third, Does the menu token module tokenize extended fields of the user profile?
Comment #4
deastlack commentedMy development environment is on my laptop, running Windows 7 as the Host OS, in an Oracle VM Virtual Box.
I have about 15 fields as a part of the user profile. Thanks for the heads up on the format for tokens; had not been able to find that documented anywhere.
Thanks for the research leads on tokens.
Comment #5
a.ross commentedNo it doesn't require a higher version of PHP than Drupal core. The undefined constant error message was fixed in this issue: #1899696: undefined constant DEBUG_BACKTRACE_IGNORE_ARGS (fix available in -dev). The cause was that this constant is only available in PHP >= 5.3.6.
As for token replacement, that's the work of the Token module. Menu token basically only invokes Token.
Comment #6
a.ross commentedFWIW, the error is reproducible (reliably) if you change this:
... to this:
So maybe you can try with a recursion limit of 2, to test?
Comment #7
cweagansIf the default recursion limit is 3, then why would it go any further than that? @deastlack, do you have any other modules that might be interacting with these tokens?
Comment #8
cweagansEither way, this needs more info before a patch can be created, right?
Comment #9
cweagansPossibly related: #1937688: Infinite loop from hook_translated_menu_link_alter()
Comment #10
a.ross commented@cweagans: I was thinking he is getting the error with the default recursion limit, even though that is pretty low. That's why I suggested trying 2 to see if that would make a difference. But he hasn't replied anymore so I agree with your status change
Comment #11
deastlack commentedSorry for the delay in responding.
The following modules are installed and enabled:
Actions permissions (VBO) 7.x-3.1 Provides permission-based access control for actions. Used by Views Bulk Operations.
Administration Development tools 7.x-3.0-rc4 Administration and debugging functionality for developers and site builders.
Administration menu 7.x-3.0-rc4 Provides a dropdown menu to most administrative tasks and other common destinations (to users with the proper permissions).
Administration Menu select 7.x-1.3 Allows users to choose which Administration menu module to use. Permissions Configure
CCK 7.x-2.x-dev Miscellaneous field functions not handled by core.
Location CCK 7.x-3.0-alpha8 Defines a Location field type.
Chaos tools 7.x-1.2 A library of helpful tools by Merlin of Chaos.
Page manager 7.x-1.2 Provides a UI and API to manage pages within the site.
Stylizer 7.x-1.2 Create custom styles for applications such as Panels.
Views content panes 7.x-1.2 Allows Views content to be used in Panels, Dashboard and other modules which use the CTools Content API.
Chart API 7.x-1.1 Google Chart API integration.
Chart API Views Integration 7.x-1.1 Provides a Google Chart API Views style.
Colorbox Node 7.x-2.6 Displays a node inside a colorbox without the header and the footer.
Context 7.x-3.0-beta6 Provide modules with a cache that lasts for a single page request.
Context OG 7.x-2.1 Provides Organic Groups conditions and reactions for the Context module.
Context UI 7.x-3.0-beta6 Provides a simple UI for settings up a site structure using Context.
Calendar 7.x-3.4 Views plugin to display views containing dates as Calendars.
Date 7.x-2.6 Makes date/time fields available.
Date All Day 7.x-2.6 Adds 'All Day' functionality to date fields, including an 'All Day' theme and 'All Day' checkboxes for the Date select and Date popup widgets.
Date API 7.x-2.6 A Date API that can be used by other modules.
Date Popup 7.x-2.6 Enables jquery popup calendars and time entry widgets for selecting dates and times.
Date Tools 7.x-2.6 Tools to import and auto-create dates and calendars.
Date Views 7.x-2.6 Views integration for date fields and date functionality.
Devel 7.x-1.3 Various blocks, pages, and functions for developers.
Watchdog Array 7.x-1.0 Allows for passing an array to the watchdog command. Help Permissions Configure
Zenophile 7.x-1.1 Quickly create Zen subthemes.
Zenophile Midnight 7.x-1.1 Aids in creating light-on-dark color schemes with Zenophile.
Zenophile Sidebars 7.x-1.1 Adds controls to adjust the width and placement of the sidebars and page.
Display suite 7.x-1.7 Extend the display options for every entity type.
Display Suite Extras 7.x-1.7 Contains additional features for Display Suite.
Display Suite Forms 7.x-1.7 Manage the layout of forms in Display Suite.
Display Suite Search 7.x-1.7 Extend the display options for search results for Drupal Core or Apache Solr.
Domain Access 7.x-3.9 A domain-based access control system
Domain Alias 7.x-3.9 Advanced domain matching methods for Domain Access.
Domain Block Title 7.x-1.0 Provide a title override for blocks for each domain when using Domain Access
Domain Blocks 7.x-3.0-alpha1 Provides domain specific visibility settings for blocks
Domain Configuration 7.x-3.9 Advanced site configuration options for Domain Access.
Domain Content 7.x-3.9 Provides a content batch editing screen for each active domain.
Domain Ctools 7.x-1.3 Chaos Tools plugins for Domain Access.
Domain Navigation 7.x-3.9 Navigation block and menu options for Domain Access
Domain Settings 7.x-3.9 Expanded site configuration options for Domain Access.
Domain Theme 7.x-3.9 Assign themes to domains created by the Domain Access module
Features 7.x-1.0 Provides feature management for Drupal.
Features Override 7.x-2.0-beta2 Allows exported Features to be overridden
ftools 7.x-1.6 Provides feature management auto download button.
FE block 7.x-1.0-alpha2 Build blocks and block settings as features.
FE nodequeue 7.x-1.0-alpha2 Build nodequeues as features.
Conditional Fields 7.x-3.x-dev Define dependencies between fields based on their states and values.
Email 7.x-1.2 Defines an email field type.
Entity Reference 7.x-1.0 Provides a field that can reference other entities.
Field collection 7.x-1.0-beta5 Provides a field collection field, to which any number of fields can be attached.
Field Permissions 7.x-1.0-beta2 Set field-level permissions to create, update or view fields.
Fieldgroup 7.x-1.1 Fieldgroup
Link 7.x-1.1 Defines simple link field types.
Markup 7.x-1.1-beta1 Defines a field type for markup.
Name Field 7.x-1.7 Defines a persons name field type.
Node Reference 7.x-2.1 Defines a field type for referencing one node from another.
Phone Number 7.x-1.x-dev The phone module allows administrators to define a field type for phone numbers.
References 7.x-2.1 Defines common base features for the various reference field types.
User Reference 7.x-2.1 Defines a field type for referencing a user from a node.
Homebox 7.x-2.0-beta6 Provides user with a page like iGoogle, Netvibes or bbc.co.uk front page
Homebox OG 7.x-2.0-beta6 Provides integration with Organic Groups and Homebox
Pathologic 7.x-2.10 Helps avoid broken links and incorrect paths in content.
Video Filter 7.x-3.1 Filter to include videos from Youtube, Google video etc
Location 7.x-3.0-alpha8 The location module allows you to associate a geographic location with content and users. Users can do proximity searches by postal code. This is useful for organizing communities that have a geographic presence.
Location Fax 7.x-3.0-alpha8 Allows you to add a fax number to a location.
Location Phone 7.x-3.0-alpha8 Allows you to add a phone number to a location.
Common Functions 7.x-1.3 Common batch and interactive workflow functions provided as part of the core Maestro module
Inline Form API Task 7.x-1.3 Inline Form API task for the Maestro module.
Maestro 7.x-1.3 Maestro workflow management system which lets you define processes and route tasks to different site users.
Mail System 7.x-2.34 Provides a user interface for per-module and site-wide mail_system selection.
Mime Mail 7.x-1.0-alpha2 Send MIME-encoded emails with embedded images and attachments.
Simplenews 7.x-1.0 Send newsletters to subscribed email addresses.
File entity 7.x-2.0-unstable7 Extends Drupal file entities to be fieldable and viewable.
Media 7.x-2.0-unstable7 Provides the core Media API
Media Field 7.x-2.0-unstable7 Provides a field type that stores media-specific data. Deprecated by the core File field type.
Media Internet Sources 7.x-2.0-unstable7 Provides an API for accessing media on various internet services
Media: Vimeo 7.x-1.0-beta5 Provides Vimeo support to the Media module.
Media: YouTube 7.x-1.0-beta3 Provides YouTube support to the Media module.
MediaFront 7.x-1.5 A front end media solution for Drupal.
Open Standards Media Player 7.x-1.5 The Open Standards Media player plugin for the MediaFront module.
Node export 7.x-3.0 Allows users to export content and then import into another Drupal installation.
Node export features 7.x-3.0 Adds Features support to Node export, so you can put your exports into Features modules.
Node export feeds 7.x-3.0 Node export feeds importer. This is a more advanced importer than the one built into node export, but tricky to use.
Nodequeue 7.x-2.0-beta1 Create queues which can contain nodes in arbitrary order
OG Forum 7.x-2.0-alpha1 Provide integration of OG with the core Forum Module
Organic groups 7.x-2.1 API to allow associating content with groups.
Organic groups access control 7.x-2.1 Enable access control for private and public groups and group content.
Organic groups context 7.x-2.1 Get a group from a viewed page.
Organic groups field access 7.x-2.1 Provide field access based on group.
Organic groups register 7.x-2.1 Allow subscribing to groups during the user registration.
Organic groups UI 7.x-2.1 Organic groups UI.
Advanced Forum 7.x-2.0+50-dev Enables the look and feel of other popular forum software.
Automated Logout 7.x-4.0+2-dev Adds automated timed logout Help Permissions
Automatic Entity Labels 7.x-1.1 Allows hiding of entity label fields and automatic label creation.
Backup and Migrate 7.x-2.4 Backup or migrate the Drupal Database quickly and without unnecessary data. Help Permissions Configure
Colorbox 7.x-2.0 A light-weight, customizable lightbox plugin for jQuery 1.4.3+.
Diff 7.x-3.2 Show differences between content revisions.
Disable messages 7.x-1.1 Add options to filter messages shown to the end users
Dynamic display block 7.x-1.0 Displays dynamic content in a block.
Entity API 7.x-1.0 Enables modules to work with any entity type and to provide entities.
Entity tokens 7.x-1.0 Provides token replacements for all properties that have no tokens and are known to the entity API.
Feedback Simple 7.x-1.6 A very simple, very light, CSS only Feedback tab. Permissions Configure
Field Collection Table 7.x-1.0-beta1 Provides a field-collection table formatter.
Flood control 7.x-1.0 Interface for hidden flood control options.
Frequently Asked Questions 7.x-1.0-rc2 Manages configuration of questions for a FAQ page.
Libraries 7.x-2.1 Allows version-dependent and shared usage of external libraries.
Menu attributes 7.x-1.0-rc2 Allows administrators to specify custom attributes for menu items.
Menu Block 7.x-2.3 Provides configurable blocks of menu items.
Menu Block Export 7.x-2.3 Provides export interface for Menu block module.
Menu position 7.x-1.1 Customize menu position of nodes depending on their content type, associated terms and others conditions.
Menu Token 7.x-1.0-beta4+2-dev Provides tokens in menu items (links).
Password policy 7.x-1.3 The password policy module allows you to enforce a specific level of password complexity for the user passwords on the system.
Pathauto 7.x-1.2 Provides a mechanism for modules to automatically generate aliases for the content they manage.
Profile Lite 7.x-1.0-alpha2 Create separate categories for user fields.
Quicktabs 7.x-3.4 Render content with tabs and other display styles
Quicktabs Styles 7.x-3.4 Adds predefined tab styles to choose from per Quicktabs instance.
Strongarm 7.x-2.0 Enforces variable values defined by modules that need settings set to operate properly.
Token 7.x-1.5 Provides a user interface for the Token API and some missing core tokens.
Video Filter Field 7.x-1.1 Provide Video Filter field formatter for text fields.
Mini panels 7.x-3.3 Create mini panels that can be used as blocks by Drupal and panes by other panel modules.
Panel nodes 7.x-3.3 Create nodes that are divided into areas with selectable content.
Panels 7.x-3.3 Core Panels display functions; provides no external UI, at least one other Panels module should be enabled.
Panels Extra Layouts 7.x-1.5 Additional layouts for the Panels module.
Panels In-Place Editor 7.x-3.3 Provide a UI for managing some Panels directly on the frontend, instead of having to use the backend.
PDF version 7.x-1.2 Adds the capability to export pages as PDF.
Printer-friendly pages 7.x-1.2 Adds a printer-friendly version link to content and administrative pages.
Send by email 7.x-1.2 Provides the capability to send the web page by email
Relation 7.x-1.0-rc4 Describes relationships between entities.
Relation Endpoints Field 7.x-1.0-rc4 Helper module for Relation. Defines endpoints field (not usable except by relation).
Rules 7.x-2.3 React on events and conditionally evaluate actions.
Rules UI 7.x-2.3 Administrative interface for managing rules.
Google Analytics 7.x-1.3 Allows your site to be tracked by Google Analytics by adding a Javascript tracking code to every page. Permissions Configure
Taxonomy CSV import/export 7.x-5.10 Export and import complete taxonomies, hierarchical structure or simple lists of terms and fields to or from a CSV file, url or text.
Features Extra test feature 7.x-1.0-alpha2 Test feature for Features Extra
jCarousel 7.x-2.6 Create jQuery-based carousel rotators. Help
Lightbox2 7.x-1.0-beta1 Enables Lightbox2 for Drupal
Universally Unique ID 7.x-1.0-alpha3+52-dev Extends the entity functionality and adds support for universally unique identifiers.
Views 7.x-3.6 Create customized lists and queries from your database.
Views Accordion 7.x-1.0-rc2 Provides an accordion views display plugin.
Views Bulk Operations 7.x-3.1 Provides a way of selecting multiple rows and applying operations to them.
Views Data Export 7.x-3.0-beta6 Plugin to export views data into various file formats
Views Field View 7.x-1.0 Embeds a view inside a view as field
Views PHP 7.x-1.x-dev Allows the usage of PHP to construct a view.
Views Slideshow 7.x-3.0 Provides a View style that displays rows as a jQuery slideshow. This is an API and requires Views Slideshow Cycle or another module that supports the API.
Views Slideshow: Cycle 7.x-3.0 Adds a Rotating slideshow mode to Views Slideshow.
Views UI 7.x-3.6 Administrative interface to views. Without this module, you cannot create or edit your views.
Fivestar 7.x-2.0-alpha2 Enables fivestar ratings on content, users, etc.
Voting API 7.x-2.11 Provides a shared voting API for other modules.
Webform 7.x-3.18 Enables the creation of forms and questionnaires.
Webform Report 7.x-1.0 Allows users to create reports from webform data.
Webform Term Options 7.x-1.1 Adds pre-built option lists of Vocabularies to be used in webform components.
Webform Validation 7.x-1.2 Add validation rules to webforms
Comment #12
a.ross commentedHmhm, I can see why your memory usage can be pretty high. Have you tried my suggestion of setting the recursion limit to 2?
Comment #13
deastlack commentedHave not yet been able to set the recursion limit to 2. Not sure where to do this.
Also, since I'm using the first generation of the Quickstart platform as my local development which contains an outdated version of UBUTU, and PHP 5.3.5, I was thinking that if I was able to update said environment then the issue might disappear. Failing that then I would try the recursion limit approach.
Tips on how to reset the recursion limit would be appreciated.
Thanks
Comment #14
a.ross commentedEdit the menu_token.module file and find the code snippet I posted above and just replace that bit of code with the second snippet I posted
Comment #15
deastlack commentedConfirmed that my local development environment was running a version of php ealier than the minimum mentioned in your documentation.
Moved the testing of the Menu Token to the Development Server which is compliant with your PHP minimum and the initial issue above no longer occurs.
I am left with the issue of how to configure the user settings to result in a path of "xyz/999" where 999 is the nid of a node referenced in profile field of the logged in user with the machine name of "field_user_affiliation" using the token "[current-user:user-affiliation]" in the path of a menu link.
I see the field in question listed in the list of available tokens but I'm unable to return a path with the required format.
Any thoughts?
Comment #16
a.ross commentedIf there isn't a token that gives you a working URL already then I think you should be able to do this:
node/[current-user:user-affiliation:nid]Comment #17
deastlack commentedHave tried "[current-page:url]" using each method setting available. either the menu option does not appear on the menu when the screen is displayed or the system returns a message stating that the path does not exist or I dont have access to it.
When I try "node/[current-user:user-affiliation:nid]" the system returns a message stating that the path does not exist or I dont have access to it.
Comment #18
a.ross commentedWell I'm not entirely sure about the exact token, but you mentioned that your initial issue is now solved? Does that mean that you can now browse the token tree in your browser? If so you should be able to find the right token easily, if not, then experiment with the token in the name of the menu link to see what the token outputs, or go to the token list for your site:
admin/help/token. This page may take a long time to load though, if it does at all.Comment #19
develcuy commented