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.
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
Comment | File | Size | Author |
---|---|---|---|
#3 | 2800513-3.patch | 706 bytes | TR |
|
Comments
Comment #2
mathiasgmeiner CreditAttribution: mathiasgmeiner commentedComment #3
TR CreditAttribution: TR commentedWe 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.
Comment #4
mathiasgmeiner CreditAttribution: mathiasgmeiner commentedThanks! Everything is fine with your patch!
Comment #6
TR CreditAttribution: TR commentedCommitted. Thanks for finding the bug and testing the fix.