Related to this change record for the token module "Theme functions have been replaced with template preprocess, render elements, or service methods" it is necessary to modify modules/contrib/ubercart/uc_stock/src/Form/StockSettingsForm.php on line 66 to

$variables = array('token_types' => array('uc_order', 'uc_stock', 'node', 'site', 'store'));
$form['token_tree'] = array(
  '#markup' => template_preprocess_token_tree_link($variables),
);

otherwise you get this error:
Fatal error: Call to undefined function Drupal\uc_stock\Form\theme_token_tree() in ../modules/contrib/ubercart/uc_stock/src/Form/StockSettingsForm.php on line 67

CommentFileSizeAuthor
#3 2800513-3.patch706 bytesTR
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mathiasgmeiner created an issue. See original summary.

mathiasgmeiner’s picture

Issue summary: View changes
TR’s picture

Title: Stock: Fix token tree browser theme callback » Fix token tree browser theme callback
Version: 8.x-4.0-alpha5 » 8.x-4.x-dev
Status: Active » Needs review
FileSize
706 bytes

We fixed the same issue in uc_cart back in #2667334: Fatal Error with token installed, but it looks like we missed the issue in uc_stock in the port to D8. This error only shows up when you have the token module enabled.

The fix is different than what you have above - the preprocess function shouldn't be called directly.

Please try this patch and let me know if it fixes the issue for you.

mathiasgmeiner’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Everything is fine with your patch!

  • TR committed 132b454 on 8.x-4.x
    Issue #2800513 by TR: Fix token tree browser theme callback
    
TR’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks for finding the bug and testing the fix.

Status: Fixed » Closed (fixed)

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