Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
Error: Call to undefined function variable_get() in affiliate_bulk_create_node_campaigns() (line 112 of drupal/html/modules/contrib/uber_affiliate/uber_affiliate.inc)
#0 drupal/html/modules/contrib/uber_affiliate/uber_affiliate.module(115): affiliate_bulk_create_node_campaigns()
There are also references to variable_del, variable_get
In Drupal 7
$data = variable_get('test_content_types');
In Drupal 8
$data = \Drupal::state()->get('test_content_types');
\Drupal::state()->set('my_data', 'foo');
$data = \Drupal::state()->get('my_data', 'bar');
\Drupal::state()->delete('my_data');
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | 3213238-remove-variable_get.patch | 29.27 KB | SocialNicheGuru |
Comments
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedgrep -in variable_ -d recurse *
uber_affiliate.html.twig:16:
uber_affiliate.inc:9: variable_del('affiliate_module_last_clicks_update');
uber_affiliate.inc:10: variable_set('affiliate_module_last_clicks_update', $time);
uber_affiliate.inc:19: variable_del('affiliate_module_last_referrals_update');
uber_affiliate.inc:20: variable_set('affiliate_module_last_referrals_update', $time);
uber_affiliate.inc:37: $lastupdate = variable_get('affiliate_module_last_referrals_update', 0);
uber_affiliate.inc:55: $lastupdate = variable_get('affiliate_module_last_clicks_update', 0);
uber_affiliate.inc:70: $lastupdate = variable_get('affiliate_module_last_referrals_update', 0);
uber_affiliate.inc:71: $cpr = variable_get('affiliate_module_payouts_per_referral', 0.00);
uber_affiliate.inc:93: $cpc = variable_get('affiliate_module_payouts_per_click', 0.00);
uber_affiliate.inc:112: $types_to_add = variable_get('affiliate_module_allowed_node_types', array());
uber_affiliate.inc:251: $allow_all_types = variable_get('affiliate_module_allow_all_node_types', 0);
uber_affiliate.inc:252: $allow_all_paths = variable_get('affiliate_module_allow_all_paths', 0);
uber_affiliate.inc:266: $allowed_node_types = variable_get('affiliate_module_allowed_node_types', array());
uber_affiliate.inc:317: if (variable_get('affiliate_module_check_referrer', 1)) {
uber_affiliate.inc:346: $allow_all_types = variable_get('affiliate_module_allow_all_node_types', 0);
uber_affiliate.inc:347: $allow_all_paths = variable_get('affiliate_module_allow_all_paths', 0);
uber_affiliate.inc:353: $allowed_node_types = variable_get('affiliate_module_allowed_node_types', array());
uber_affiliate.inc:385: $menu_prefix = variable_get('affiliate_module_affiliate_menu_path', 'affiliate');
uber_affiliate.inc:490: $points = (int) variable_get('affiliate_module_payouts_userpoints_clicks', 0);
uber_affiliate.inc:495: 'tid' => variable_get('affiliate_module_payouts_userpoints_tid', 0),
uber_affiliate.inc:526: $denied_users = explode("\n", variable_get('affiliate_module_ignored_users', ''));
uber_affiliate.inc:531: $denied_ips = explode("\n", variable_get('affiliate_module_ignored_ips', ''));
uber_affiliate.inc:542: $denied_uri_referrers = explode("\n", variable_get('affiliate_module_ignored_uri_referrers', ''));
uber_affiliate.inc:554: $enabled = variable_get('affiliate_module_click_ignore_enable', 0);
uber_affiliate.inc:561: $interval = variable_get('affiliate_module_click_ignore_interval', 86400);
uber_affiliate.inc:571: $allow_all_paths = variable_get('affiliate_module_allow_all_paths', 0);
uber_affiliate.inc:572: $allow_all_node_types = variable_get('affiliate_module_allow_all_node_types', 0);
uber_affiliate.inc:701: $payouts_symbol = variable_get('affiliate_module_payouts_symbol', '$');
uber_affiliate.inc:702: $payouts_symbol_pos = variable_get('affiliate_module_payouts_symbol_placement', 1);
uber_affiliate.inc:703: $payouts_amount = variable_get('affiliate_module_payouts_per_click', 0.00);
uber_affiliate.inc:748: $payouts_symbol = variable_get('affiliate_module_payouts_symbol', '$');
uber_affiliate.inc:749: $payouts_symbol_pos = variable_get('affiliate_module_payouts_symbol_placement', 1);
uber_affiliate.inc:750: $payouts_amount = variable_get('affiliate_module_payouts_per_click', 0.00);
uber_affiliate.inc:825: '#default_value' => variable_get('affiliate_module_allow_all_users', 0),
uber_affiliate.inc:832: '#default_value' => variable_get('affiliate_module_check_referrer', 1),
uber_affiliate.inc:839: '#default_value' => variable_get('affiliate_module_click_ignore_enable', 0),
uber_affiliate.inc:846: '#default_value' => variable_get('affiliate_module_click_ignore_interval', 86400),
uber_affiliate.inc:858: '#default_value' => variable_get('affiliate_module_ignored_uri_referrers', ''),
uber_affiliate.inc:866: '#default_value' => variable_get('affiliate_module_ignored_ips', ''),
uber_affiliate.inc:874: '#default_value' => variable_get('affiliate_module_ignored_users', ''),
uber_affiliate.inc:888: '#default_value' => variable_get('affiliate_module_top_users_count_page', 5),
uber_affiliate.inc:895: '#default_value' => variable_get('affiliate_module_top_users_count_block', 5),
uber_affiliate.inc:902: '#default_value' => variable_get('affiliate_module_top_users_period_interval', 259200),
uber_affiliate.inc:915: '#default_value' => variable_get('affiliate_module_affiliate_menu_path', 'affiliate'),
uber_affiliate.inc:922: '#default_value' => variable_get('affiliate_module_allow_all_paths', 0),
uber_affiliate.inc:929: '#default_value' => variable_get('affiliate_module_allow_all_node_types', 0),
uber_affiliate.inc:941: '#default_value' => variable_get('affiliate_module_allowed_node_types', array()),
uber_affiliate.inc:954: '#default_value' => variable_get('affiliate_module_affiliate_link_text', t('Copy the code below and paste it into your website')),
uber_affiliate.inc:971: $menu_path_current = variable_get('affiliate_module_affiliate_menu_path', 'affiliate');
uber_affiliate.inc:989: $menu_path_current = variable_get('affiliate_module_affiliate_menu_path', 'affiliate');
uber_affiliate.inc:1019: '#default_value' => variable_get('affiliate_module_payouts_symbol', '$'),
uber_affiliate.inc:1026: '#default_value' => variable_get('affiliate_module_payouts_symbol_placement', 1),
uber_affiliate.inc:1033: '#default_value' => variable_get('affiliate_module_payouts_per_click', 0.00),
uber_affiliate.inc:1045: '#default_value' => variable_get('affiliate_module_payouts_per_referral', 0.00),
uber_affiliate.inc:1057: '#default_value' => variable_get('affiliate_module_payouts_userpoints_clicks', 0),
uber_affiliate.inc:1065: '#default_value' => variable_get('affiliate_module_payouts_userpoints_tid', 0),
uber_affiliate.inc:1074: $limit = variable_get('affiliate_module_top_users_count_page', 10);
uber_affiliate.inc:1076: $time_interval = variable_get('affiliate_module_top_users_period_interval', 259200);
uber_affiliate.inc:1106: $limit = variable_get('affiliate_module_top_users_count_block', 10);
uber_affiliate.inc:1108: $time_interval = variable_get('affiliate_module_top_users_period_interval', 259200);
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #4
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedhttps://www.zyxware.com/articles/5482/drupal-8-article-about-how-to-conf...
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #6
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #7
binnythomas CreditAttribution: binnythomas at Axelerant for Drupal India Association commentedThanks for the patch.
I started this module when I had a lot of available time. However it got sidetracked when I got into a couple of other commitments. So the module is not ready at all at the stage and is basically the D7 module with a few tidbits of the beginning of D8 code.
P.S. If you would like to contribute to the module and you have the bandwidth, I can make you the co maintainer. Please raise a ticket for co maintainter access. Thanks
Comment #9
binnythomas CreditAttribution: binnythomas at Axelerant for Drupal India Association commentedApplied the patch. Seems to be working. Thanks for the patch.
Comment #10
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedNo worries. I like making things work.