After a fresh install of both drupal and ubercart attempting to reach the checkout settings page results in a fatal error with token module installed:

Fatal error: Call to undefined function Drupal\uc_cart\Form\theme() in /path/to/web/modules/ubercart/uc_cart/src/Form/CheckoutSettingsForm.php on line 261

   if (\Drupal::moduleHandler()->moduleExists('token')) {
      $form['completion_messages']['token_tree'] = array(
        '#markup' => theme('token_tree', array('token_types' => array('uc_order', 'site', 'store'))),
      );

Issue seemed to cease to exist after uninstalling token.

if this is a token issue I apologize.

CommentFileSizeAuthor
#3 token-tree.patch638 bytesTR
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sushichris created an issue. See original summary.

TR’s picture

Version: 8.x-4.0-alpha3 » 8.x-4.x-dev
Issue tags: -Ubercart, -token, -Fatal error: Call to undefined function, -checkout

Yes, this is a problem in uc_cart/src/Form/CheckoutSettingsForm.php, where we display the list of available tokens if the Token module is enabled. Core Drupal has a lot of the Token functionality, but doesn't have a function to print this list, which is why we do it only when Token is enabled.

It looks like that line of code never got ported to D8. We should be able to fix this quickly...

TR’s picture

Status: Active » Needs review
Related issues: +#2640138: Use token_tree_link instead of token_tree to render links
FileSize
638 bytes

Try this:

TR’s picture

Status: Needs review » Fixed

Committed.

  • TR committed 4e66aa8 on 8.x-4.x
    Issue #2667334 by TR: Fatal Error with token installed
    
sushichris’s picture

Awesome! its working fine, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.