Jump to content
Latest News: (loading..)
jerone

PHP 7.2 each() function deprecated

Recommended Posts

When you are upgrading OsCommerce to be compatible in +PHP7.2 versions, here is a pattern on how to update while = each() loops to foreach, which is said to be like 10 times faster, too!

Case 1: Missing $value

reset($array);
while (list($key, ) = each($array)) {

Update to:

foreach(array_keys($array) as $key) {

Case 2: Missing $key

reset($array);
while (list(, $value) = each($array)) {

Update to:

foreach($array as $value) {

Case 3: Not missing anything

reset($array);
while (list($key, $value) = each($array)) {

Update to:

foreach($array as $key => $value) {

Share this post


Link to post
Share on other sites

Have done a quick search, also found;

function unserialize($broken) {
      for(reset($broken);$kv=each($broken);) {

Pretty sure this function can be entirely removed from the three files it is in.  
Comments anyone ?

and

        while ($tables = tep_db_fetch_array($tables_query)) {
          list(,$table) = each($tables);

TO

        while ($tables = tep_db_fetch_array($tables_query)) {
          $table = reset($tables);

 

Edited by burt

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

I did inform long time ago here:

Thank you @jerone for the infos how to change. I did a different changing, but your changes are much more efective.

What happens in /admin/backup.php with

while (list($kname, $info) = each($index)) {

and

while (list(,$i) = each($table_list)) {

 

@burt i did remove this function. Everything works fine. No problem at all.

function unserialize($broken) {
      for(reset($broken);$kv=each($broken);) {

 


  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites

Hi,

I just downloaded EDGE (dated April 10) into my PHP 7.2 sandbox. PHP throws quite a few warnings related to undefined constants:

PHP Warning:  Use of undefined constant MODULE_BOXES_BEST_SELLERS_TITLE - assumed 'MODULE_BOXES_BEST_SELLERS_TITLE' (this will throw an Error in a future version of PHP) in includes/modules/boxes/bm_best_sellers.php on line 22
Same kind of warnings:
MODULE_BOXES_BEST_SELLERS_DESCRIPTION   includes/modules/boxes/bm_best_sellers.php on line 23
MODULE_BOXES_CARD_ACCEPTANCE_TITLE   includes/modules/boxes/bm_card_acceptance.php on line 22
MODULE_BOXES_CARD_ACCEPTANCE_DESCRIPTION   includes/modules/boxes/bm_card_acceptance.php on line 23
MODULE_BOXES_MANUFACTURERS_TITLE   includes/modules/boxes/bm_manufacturers.php on line 22
MODULE_BOXES_MANUFACTURERS_DESCRIPTION   includes/modules/boxes/bm_manufacturers.php on line 23
MODULE_BOXES_INFORMATION_TITLE  includes/modules/boxes/bm_information.php on line 22
MODULE_BOXES_INFORMATION_DESCRIPTION   includes/modules/boxes/bm_information.php on line 23
MODULE_BOXES_SEARCH_TITLE includes/modules/boxes/bm_search.php on line 22
MODULE_BOXES_SEARCH_DESCRIPTION   includes/modules/boxes/bm_search.php on line 23
MODULE_BOXES_SHOPPING_CART_TITLE   includes/modules/boxes/bm_shopping_cart.php on line 22
MODULE_BOXES_SHOPPING_CART_DESCRIPTION   includes/modules/boxes/bm_shopping_cart.php on line 23
MODULE_BOXES_SPECIALS_TITLE   includes/modules/boxes/bm_specials.php on line 22
MODULE_BOXES_SPECIALS_DESCRIPTION   includes/modules/boxes/bm_specials.php on line 23
MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_TITLE   includes/modules/boxes/bm_product_social_bookmarks.php on line 22
MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_DESCRIPTION  includes/modules/boxes/bm_product_social_bookmarks.php on line 23
MODULE_PAYMENT_CHRONOPAY_SORT_ORDER includes/modules/payment/chronopay.php on line 26
MODULE_PAYMENT_CHRONOPAY_STATUS includes/modules/payment/chronopay.php on line 27
MODULE_PAYMENT_CHRONOPAY_PREPARE_ORDER_STATUS_ID includes/modules/payment/chronopay.php on line 29
MODULE_PAYMENT_INPAY_SORT_ORDER includes/modules/payment/inpay.php on line 25
MODULE_PAYMENT_INPAY_STATUS includes/modules/payment/inpay.php on line 26
MODULE_PAYMENT_INPAY_GATEWAY_SERVER includes/modules/payment/inpay.php on line 35
MODULE_PAYMENT_IPAYMENT_CC_SORT_ORDER includes/modules/payment/ipayment_cc.php on line 27
MODULE_PAYMENT_IPAYMENT_CC_STATUS includes/modules/payment/ipayment_cc.php on line 28
MODULE_PAYMENT_IPAYMENT_CC_ORDER_STATUS_ID includes/modules/payment/ipayment_cc.php on line 30
MODULE_PAYMENT_IPAYMENT_CC_ID includes/modules/payment/ipayment_cc.php on line 38
MODULE_PAYMENT_IPAYMENT_ELV_SORT_ORDER includes/modules/payment/ipayment_elv.php on line 27
MODULE_PAYMENT_IPAYMENT_ELV_STATUS includes/modules/payment/ipayment_elv.php on line 28
MODULE_PAYMENT_IPAYMENT_ELV_ORDER_STATUS_ID includes/modules/payment/ipayment_elv.php on line 30
MODULE_PAYMENT_IPAYMENT_ELV_ID includes/modules/payment/ipayment_elv.php on line 38
MODULE_PAYMENT_IPAYMENT_PP_SORT_ORDER includes/modules/payment/ipayment_pp.php on line 27
MODULE_PAYMENT_IPAYMENT_PP_STATUS includes/modules/payment/ipayment_pp.php on line 28
MODULE_PAYMENT_IPAYMENT_PP_ORDER_STATUS_ID includes/modules/payment/ipayment_pp.php on line 30
MODULE_PAYMENT_IPAYMENT_PP_ID includes/modules/payment/ipayment_pp.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SORT_ORDER includes/modules/payment/moneybookers.php on line 31
MODULE_PAYMENT_MONEYBOOKERS_STATUS includes/modules/payment/moneybookers.php on line 32
MODULE_PAYMENT_MONEYBOOKERS_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers.php on line 34
MODULE_PAYMENT_MONEYBOOKERS_ACC_SORT_ORDER includes/modules/payment/moneybookers_acc.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_ACC_STATUS includes/modules/payment/moneybookers_acc.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_ACC_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_acc.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_BWI_SORT_ORDER includes/modules/payment/moneybookers_bwi.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_BWI_STATUS includes/modules/payment/moneybookers_bwi.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_BWI_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_bwi.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_CSI_SORT_ORDER includes/modules/payment/moneybookers_csi.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_CSI_STATUS includes/modules/payment/moneybookers_csi.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_CSI_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_csi.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_DID_SORT_ORDER includes/modules/payment/moneybookers_did.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_DID_STATUS includes/modules/payment/moneybookers_did.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_DID_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_did.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_DNK_SORT_ORDER includes/modules/payment/moneybookers_dnk.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_DNK_STATUS includes/modules/payment/moneybookers_dnk.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_DNK_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_dnk.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_EBT_SORT_ORDER includes/modules/payment/moneybookers_ebt.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_EBT_STATUS includes/modules/payment/moneybookers_ebt.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_EBT_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_ebt.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_ENT_SORT_ORDER includes/modules/payment/moneybookers_ent.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_ENT_STATUS includes/modules/payment/moneybookers_ent.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_ENT_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_ent.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_GCB_SORT_ORDER includes/modules/payment/moneybookers_gcb.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_GCB_STATUS includes/modules/payment/moneybookers_gcb.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_GCB_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_gcb.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_GIR_SORT_ORDER includes/modules/payment/moneybookers_gir.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_GIR_STATUS includes/modules/payment/moneybookers_gir.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_GIR_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_gir.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_IDL_SORT_ORDER includes/modules/payment/moneybookers_idl.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_IDL_STATUS includes/modules/payment/moneybookers_idl.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_IDL_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_idl.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_LSR_SORT_ORDER includes/modules/payment/moneybookers_lsr.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_LSR_STATUS includes/modules/payment/moneybookers_lsr.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_LSR_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_lsr.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_MAE_SORT_ORDER includes/modules/payment/moneybookers_mae.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_MAE_STATUS includes/modules/payment/moneybookers_mae.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_MAE_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_mae.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_MSC_SORT_ORDER includes/modules/payment/moneybookers_msc.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_MSC_STATUS includes/modules/payment/moneybookers_msc.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_MSC_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_msc.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_NGP_SORT_ORDER includes/modules/payment/moneybookers_ngp.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_NGP_STATUS includes/modules/payment/moneybookers_ngp.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_NGP_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_ngp.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_NPY_SORT_ORDER includes/modules/payment/moneybookers_npy.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_NPY_STATUS includes/modules/payment/moneybookers_npy.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_NPY_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_npy.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_PLI_SORT_ORDER includes/modules/payment/moneybookers_pli.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_PLI_STATUS includes/modules/payment/moneybookers_pli.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_PLI_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_pli.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_PSP_SORT_ORDER includes/modules/payment/moneybookers_psp.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_PSP_STATUS includes/modules/payment/moneybookers_psp.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_PSP_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_psp.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_PWY_SORT_ORDER includes/modules/payment/moneybookers_pwy.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_PWY_STATUS includes/modules/payment/moneybookers_pwy.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_PWY_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_pwy.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SFT_SORT_ORDER includes/modules/payment/moneybookers_sft.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_SFT_STATUS includes/modules/payment/moneybookers_sft.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_SFT_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_sft.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SLO_SORT_ORDER includes/modules/payment/moneybookers_slo.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_SLO_STATUS includes/modules/payment/moneybookers_slo.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_SLO_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_slo.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SO2_SORT_ORDER includes/modules/payment/moneybookers_so2.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_SO2_STATUS includes/modules/payment/moneybookers_so2.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_SO2_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_so2.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_VSA_SORT_ORDER includes/modules/payment/moneybookers_vsa.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_VSA_STATUS includes/modules/payment/moneybookers_vsa.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_VSA_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_vsa.php on line 38
MODULE_PAYMENT_MONEYORDER_PAYTO includes/languages/english/modules/payment/moneyorder.php on line 14
MODULE_PAYMENT_MONEYORDER_PAYTO includes/languages/english/modules/payment/moneyorder.php on line 15
MODULE_PAYMENT_MONEYORDER_SORT_ORDER includes/modules/payment/moneyorder.php on line 23
MODULE_PAYMENT_MONEYORDER_STATUS includes/modules/payment/moneyorder.php on line 24
MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID includes/modules/payment/moneyorder.php on line 26
MODULE_PAYMENT_NOCHEX_SORT_ORDER includes/modules/payment/nochex.php on line 23
MODULE_PAYMENT_NOCHEX_STATUS includes/modules/payment/nochex.php on line 24
MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID includes/modules/payment/nochex.php on line 26
MODULE_PAYMENT_PAYPOINT_SECPAY_SORT_ORDER includes/modules/payment/paypoint_secpay.php on line 26
MODULE_PAYMENT_PAYPOINT_SECPAY_STATUS includes/modules/payment/paypoint_secpay.php on line 27
MODULE_PAYMENT_PAYPOINT_SECPAY_ORDER_STATUS_ID includes/modules/payment/paypoint_secpay.php on line 29
MODULE_PAYMENT_2CHECKOUT_SORT_ORDER includes/modules/payment/pm2checkout.php on line 26
MODULE_PAYMENT_2CHECKOUT_STATUS includes/modules/payment/pm2checkout.php on line 27
MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID includes/modules/payment/pm2checkout.php on line 29
MODULE_PAYMENT_PSIGATE_SORT_ORDER includes/modules/payment/psigate.php on line 23
MODULE_PAYMENT_PSIGATE_STATUS includes/modules/payment/psigate.php on line 24
MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID includes/modules/payment/psigate.php on line 26
MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_SERVER includes/modules/payment/sage_pay_form.php on line 57
MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_SORT_ORDER includes/modules/payment/sofortueberweisung_direct.php on line 25
MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STATUS includes/modules/payment/sofortueberweisung_direct.php on line 26
MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID includes/modules/payment/sofortueberweisung_direct.php on line 28

 

 

Share this post


Link to post
Share on other sites
On 15/04/2018 at 9:43 AM, vmn said:

Hi,

I just downloaded EDGE (dated April 10) into my PHP 7.2 sandbox. PHP throws quite a few warnings related to undefined constants:

PHP Warning:  Use of undefined constant MODULE_BOXES_BEST_SELLERS_TITLE - assumed 'MODULE_BOXES_BEST_SELLERS_TITLE' (this will throw an Error in a future version of PHP) in includes/modules/boxes/bm_best_sellers.php on line 22
Same kind of warnings:
MODULE_BOXES_BEST_SELLERS_DESCRIPTION   includes/modules/boxes/bm_best_sellers.php on line 23
MODULE_BOXES_CARD_ACCEPTANCE_TITLE   includes/modules/boxes/bm_card_acceptance.php on line 22
MODULE_BOXES_CARD_ACCEPTANCE_DESCRIPTION   includes/modules/boxes/bm_card_acceptance.php on line 23
MODULE_BOXES_MANUFACTURERS_TITLE   includes/modules/boxes/bm_manufacturers.php on line 22
MODULE_BOXES_MANUFACTURERS_DESCRIPTION   includes/modules/boxes/bm_manufacturers.php on line 23
MODULE_BOXES_INFORMATION_TITLE  includes/modules/boxes/bm_information.php on line 22
MODULE_BOXES_INFORMATION_DESCRIPTION   includes/modules/boxes/bm_information.php on line 23
MODULE_BOXES_SEARCH_TITLE includes/modules/boxes/bm_search.php on line 22
MODULE_BOXES_SEARCH_DESCRIPTION   includes/modules/boxes/bm_search.php on line 23
MODULE_BOXES_SHOPPING_CART_TITLE   includes/modules/boxes/bm_shopping_cart.php on line 22
MODULE_BOXES_SHOPPING_CART_DESCRIPTION   includes/modules/boxes/bm_shopping_cart.php on line 23
MODULE_BOXES_SPECIALS_TITLE   includes/modules/boxes/bm_specials.php on line 22
MODULE_BOXES_SPECIALS_DESCRIPTION   includes/modules/boxes/bm_specials.php on line 23
MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_TITLE   includes/modules/boxes/bm_product_social_bookmarks.php on line 22
MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_DESCRIPTION  includes/modules/boxes/bm_product_social_bookmarks.php on line 23
MODULE_PAYMENT_CHRONOPAY_SORT_ORDER includes/modules/payment/chronopay.php on line 26
MODULE_PAYMENT_CHRONOPAY_STATUS includes/modules/payment/chronopay.php on line 27
MODULE_PAYMENT_CHRONOPAY_PREPARE_ORDER_STATUS_ID includes/modules/payment/chronopay.php on line 29
MODULE_PAYMENT_INPAY_SORT_ORDER includes/modules/payment/inpay.php on line 25
MODULE_PAYMENT_INPAY_STATUS includes/modules/payment/inpay.php on line 26
MODULE_PAYMENT_INPAY_GATEWAY_SERVER includes/modules/payment/inpay.php on line 35
MODULE_PAYMENT_IPAYMENT_CC_SORT_ORDER includes/modules/payment/ipayment_cc.php on line 27
MODULE_PAYMENT_IPAYMENT_CC_STATUS includes/modules/payment/ipayment_cc.php on line 28
MODULE_PAYMENT_IPAYMENT_CC_ORDER_STATUS_ID includes/modules/payment/ipayment_cc.php on line 30
MODULE_PAYMENT_IPAYMENT_CC_ID includes/modules/payment/ipayment_cc.php on line 38
MODULE_PAYMENT_IPAYMENT_ELV_SORT_ORDER includes/modules/payment/ipayment_elv.php on line 27
MODULE_PAYMENT_IPAYMENT_ELV_STATUS includes/modules/payment/ipayment_elv.php on line 28
MODULE_PAYMENT_IPAYMENT_ELV_ORDER_STATUS_ID includes/modules/payment/ipayment_elv.php on line 30
MODULE_PAYMENT_IPAYMENT_ELV_ID includes/modules/payment/ipayment_elv.php on line 38
MODULE_PAYMENT_IPAYMENT_PP_SORT_ORDER includes/modules/payment/ipayment_pp.php on line 27
MODULE_PAYMENT_IPAYMENT_PP_STATUS includes/modules/payment/ipayment_pp.php on line 28
MODULE_PAYMENT_IPAYMENT_PP_ORDER_STATUS_ID includes/modules/payment/ipayment_pp.php on line 30
MODULE_PAYMENT_IPAYMENT_PP_ID includes/modules/payment/ipayment_pp.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SORT_ORDER includes/modules/payment/moneybookers.php on line 31
MODULE_PAYMENT_MONEYBOOKERS_STATUS includes/modules/payment/moneybookers.php on line 32
MODULE_PAYMENT_MONEYBOOKERS_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers.php on line 34
MODULE_PAYMENT_MONEYBOOKERS_ACC_SORT_ORDER includes/modules/payment/moneybookers_acc.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_ACC_STATUS includes/modules/payment/moneybookers_acc.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_ACC_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_acc.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_BWI_SORT_ORDER includes/modules/payment/moneybookers_bwi.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_BWI_STATUS includes/modules/payment/moneybookers_bwi.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_BWI_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_bwi.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_CSI_SORT_ORDER includes/modules/payment/moneybookers_csi.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_CSI_STATUS includes/modules/payment/moneybookers_csi.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_CSI_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_csi.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_DID_SORT_ORDER includes/modules/payment/moneybookers_did.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_DID_STATUS includes/modules/payment/moneybookers_did.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_DID_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_did.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_DNK_SORT_ORDER includes/modules/payment/moneybookers_dnk.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_DNK_STATUS includes/modules/payment/moneybookers_dnk.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_DNK_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_dnk.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_EBT_SORT_ORDER includes/modules/payment/moneybookers_ebt.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_EBT_STATUS includes/modules/payment/moneybookers_ebt.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_EBT_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_ebt.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_ENT_SORT_ORDER includes/modules/payment/moneybookers_ent.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_ENT_STATUS includes/modules/payment/moneybookers_ent.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_ENT_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_ent.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_GCB_SORT_ORDER includes/modules/payment/moneybookers_gcb.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_GCB_STATUS includes/modules/payment/moneybookers_gcb.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_GCB_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_gcb.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_GIR_SORT_ORDER includes/modules/payment/moneybookers_gir.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_GIR_STATUS includes/modules/payment/moneybookers_gir.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_GIR_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_gir.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_IDL_SORT_ORDER includes/modules/payment/moneybookers_idl.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_IDL_STATUS includes/modules/payment/moneybookers_idl.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_IDL_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_idl.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_LSR_SORT_ORDER includes/modules/payment/moneybookers_lsr.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_LSR_STATUS includes/modules/payment/moneybookers_lsr.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_LSR_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_lsr.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_MAE_SORT_ORDER includes/modules/payment/moneybookers_mae.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_MAE_STATUS includes/modules/payment/moneybookers_mae.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_MAE_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_mae.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_MSC_SORT_ORDER includes/modules/payment/moneybookers_msc.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_MSC_STATUS includes/modules/payment/moneybookers_msc.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_MSC_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_msc.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_NGP_SORT_ORDER includes/modules/payment/moneybookers_ngp.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_NGP_STATUS includes/modules/payment/moneybookers_ngp.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_NGP_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_ngp.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_NPY_SORT_ORDER includes/modules/payment/moneybookers_npy.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_NPY_STATUS includes/modules/payment/moneybookers_npy.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_NPY_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_npy.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_PLI_SORT_ORDER includes/modules/payment/moneybookers_pli.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_PLI_STATUS includes/modules/payment/moneybookers_pli.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_PLI_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_pli.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_PSP_SORT_ORDER includes/modules/payment/moneybookers_psp.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_PSP_STATUS includes/modules/payment/moneybookers_psp.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_PSP_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_psp.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_PWY_SORT_ORDER includes/modules/payment/moneybookers_pwy.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_PWY_STATUS includes/modules/payment/moneybookers_pwy.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_PWY_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_pwy.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SFT_SORT_ORDER includes/modules/payment/moneybookers_sft.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_SFT_STATUS includes/modules/payment/moneybookers_sft.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_SFT_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_sft.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SLO_SORT_ORDER includes/modules/payment/moneybookers_slo.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_SLO_STATUS includes/modules/payment/moneybookers_slo.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_SLO_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_slo.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_SO2_SORT_ORDER includes/modules/payment/moneybookers_so2.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_SO2_STATUS includes/modules/payment/moneybookers_so2.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_SO2_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_so2.php on line 38
MODULE_PAYMENT_MONEYBOOKERS_VSA_SORT_ORDER includes/modules/payment/moneybookers_vsa.php on line 35
MODULE_PAYMENT_MONEYBOOKERS_VSA_STATUS includes/modules/payment/moneybookers_vsa.php on line 36
MODULE_PAYMENT_MONEYBOOKERS_VSA_PREPARE_ORDER_STATUS_ID includes/modules/payment/moneybookers_vsa.php on line 38
MODULE_PAYMENT_MONEYORDER_PAYTO includes/languages/english/modules/payment/moneyorder.php on line 14
MODULE_PAYMENT_MONEYORDER_PAYTO includes/languages/english/modules/payment/moneyorder.php on line 15
MODULE_PAYMENT_MONEYORDER_SORT_ORDER includes/modules/payment/moneyorder.php on line 23
MODULE_PAYMENT_MONEYORDER_STATUS includes/modules/payment/moneyorder.php on line 24
MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID includes/modules/payment/moneyorder.php on line 26
MODULE_PAYMENT_NOCHEX_SORT_ORDER includes/modules/payment/nochex.php on line 23
MODULE_PAYMENT_NOCHEX_STATUS includes/modules/payment/nochex.php on line 24
MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID includes/modules/payment/nochex.php on line 26
MODULE_PAYMENT_PAYPOINT_SECPAY_SORT_ORDER includes/modules/payment/paypoint_secpay.php on line 26
MODULE_PAYMENT_PAYPOINT_SECPAY_STATUS includes/modules/payment/paypoint_secpay.php on line 27
MODULE_PAYMENT_PAYPOINT_SECPAY_ORDER_STATUS_ID includes/modules/payment/paypoint_secpay.php on line 29
MODULE_PAYMENT_2CHECKOUT_SORT_ORDER includes/modules/payment/pm2checkout.php on line 26
MODULE_PAYMENT_2CHECKOUT_STATUS includes/modules/payment/pm2checkout.php on line 27
MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID includes/modules/payment/pm2checkout.php on line 29
MODULE_PAYMENT_PSIGATE_SORT_ORDER includes/modules/payment/psigate.php on line 23
MODULE_PAYMENT_PSIGATE_STATUS includes/modules/payment/psigate.php on line 24
MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID includes/modules/payment/psigate.php on line 26
MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_SERVER includes/modules/payment/sage_pay_form.php on line 57
MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_SORT_ORDER includes/modules/payment/sofortueberweisung_direct.php on line 25
MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STATUS includes/modules/payment/sofortueberweisung_direct.php on line 26
MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID includes/modules/payment/sofortueberweisung_direct.php on line 28

 

 

I'm having this issue too.

Share this post


Link to post
Share on other sites

follow the error trail...line 22 in that file. that constant is defined in the module's language file...make sure the default or language is set to english. the default language files should be there...

 

 

On 4/15/2018 at 1:43 AM, vmn said:

Hi,

I just downloaded EDGE (dated April 10) into my PHP 7.2 sandbox. PHP throws quite a few warnings related to undefined constants:

PHP Warning:  Use of undefined constant MODULE_BOXES_BEST_SELLERS_TITLE - assumed 'MODULE_BOXES_BEST_SELLERS_TITLE' (this will throw an Error in a future version of PHP) in includes/modules/boxes/bm_best_sellers.php on line 22

 

 

 

 

Share this post


Link to post
Share on other sites
Posted (edited)
On 2/11/2018 at 8:26 PM, burt said:

Have done a quick search, also found;


function unserialize($broken) {
      for(reset($broken);$kv=each($broken);) {

Pretty sure this function can be entirely removed from the three files it is in.  
Comments anyone ?

I have the unserialize function being used in several files including add-on files.

Any suggestion on how to modify it for php 7.2 compatibility, instead of removing it?

Edited by dr_lucas

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks @bonbec

Any suggestions on how make code like this php 7.2 compatible?

                foreach ($dhlAirborneQuotes as $dhlAirborneQuote) {
                    list($type, $cost) = each($dhlAirborneQuote);
                    if ($cost != '0.00') {
                        $methods[] = array(
                            'id' => $type,
                            'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type) . $dhlAirborneQuote['description'],
                            'cost' => ($cost) + MODULE_SHIPPING_AIRBORNE_HANDLING
                        );
                    }
                }

It throws a "deprecated" notice on the line with the "each" (2nd line).

Edited by dr_lucas

Share this post


Link to post
Share on other sites

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
Posted (edited)

Indeed I changed it to this previously:

foreach ($dhlAirborneQuotes as $dhlAirborneQuote) {
                  // list($type, $cost) = each($dhlAirborneQuote);
				   $type = key($dhlAirborneQuote);
				   $cost = current($dhlAirborneQuote);
                    if ($cost != '0.00') {
                        $methods[] = array(
                            'id' => $type,
                            'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type) . $dhlAirborneQuote['description'],
                            'cost' => ($cost) + MODULE_SHIPPING_AIRBORNE_HANDLING
                        );
                    }
                }

But wasn't sure if that's the correct way to make it function identically and PHP 7.2 compatible. Any comments?

Edited by dr_lucas

Share this post


Link to post
Share on other sites
Posted (edited)

This following line should be changed as shown:

list($type, $cost) = each($dhlAirborneQuote);
 $type = $dhlAirborneQuote['type'];
 $cost = $dhlAirborneQuote['cost'];

 

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

Thanks @Jack_mcs

Does that mean that my modification:

$type = key($dhlAirborneQuote);
$cost = current($dhlAirborneQuote);

Is incorrect?

Share this post


Link to post
Share on other sites

No, your code should work. I was looking at the line above it so didn't catch that you were using those commands. You're supposed to check the result when they are used so maybe that is causing a problem? Do you get an error?  For what it's worth, the way I would code it is like this:

foreach ($dhlAirborneQuotes as $arry) {
  foreach ($arry as $type => $cost) {
    if ($cost != '0.00') {
        $methods[] = array(
            'id' => $type,
            'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type) . $arry['description'],
            'cost' => ($cost) + MODULE_SHIPPING_AIRBORNE_HANDLING
        );
    }
  }  
}

 

Share this post


Link to post
Share on other sites

Thanks, @Jack_mcs
Any suggestions how to modify these 2 functions to be php 7.2 compatible?

  function session_unregister($var) {
    global $session;

    for (reset($session->vars); list($i)=each($session->vars);) {
      if ($session->vars[$i] == trim($var)) {
        unset($session->vars[$i]);
        break;
      }
    }
  }

  function session_is_registered($var) {
    global $session;

    for (reset($session->vars); list($i)=each($session->vars);) {
      if ($session->vars[$i] == trim($var)) {
        return true;
      }
    }

    return false;
  }

I have tried to modify this:

for (reset($session->vars); list($i)=each($session->vars);) {

TO:

foreach (array_keys($session->vars) as $i) {

But not sure if that is correct.

Edited by dr_lucas

Share this post


Link to post
Share on other sites

The frozen version should be 7.2 compatible so a quick way to go is to look at the code it used. Here is the first function in it:

  function tep_session_unregister($variable) {
    if (PHP_VERSION < 4.3) {
      return session_unregister($variable);
    } else {
      unset($_SESSION[$variable]);
    }
  }

 

Share this post


Link to post
Share on other sites

@Jack_mcs

Thanks. This is not tep_session_unregister, it's session_unregister, but anyways I later on noticed it's only meant for PHP < 4.3 via  tep_session_unregister anyway, so no worries.

Share this post


Link to post
Share on other sites

I'm sorry. I didn't notice that. The session_... functions are native php functions and should not be called directly. As you mentioned, it shows here it is no longer allowed. One should always use the tep_ functions since they take such things into account. You probably know this but I post this for others that may have the problem in the future.

Share this post


Link to post
Share on other sites

Actually those 2 functions session_unregister and session_is_registered used to be native php functions but removed since php >=5.4, so this was an attempt to emulate them, which is ok.

That said, I noticed I no longer need that after going through the rest of the code. :)

Thanks again, @Jack_mcs

Edited by dr_lucas

Share this post


Link to post
Share on other sites

 

On 7/13/2018 at 6:39 PM, Jack_mcs said:

The frozen version should be 7.2 compatible

@Jack_mcs 

Heads up to you and the developers. While FROZEN is mostly PHP 7.2 compatible, there are still many issues that require fixing there at the moment, as it throws lots of errors on PHP 7.2, especially "not countable" errors.

For example:

for ($i=0, $n=sizeof($values); $i<$n; $i++) {

From html_output.php will throw errors if $values is null.

Plenty of other sizeof() and count() issues (among others) in that release.

Another issue I just bumped into, although it's a rarely used file in most stores, admin/includes/classes/phplot.php is missing a bracket here

if (is_array($color_asked) && (count($color_asked) == 3))

And admin/categories.php 

this:

foreach ($products_delete as $key) {
            tep_remove_product($key);

must  be change to

foreach (array_keys($products_delete) as $key) {
            tep_remove_product($key);

 

Share this post


Link to post
Share on other sites

You may want to post in this thread. I think the phplot probable was already mentioned.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×