Jump to content
thirty bees forum

Module issue with newsletter subscriptions after update to latest bleeding edge. Likely permissions issue. Assistance needed.


Recommended Posts

Posted

We use pop up module by Rolige, https://addons.prestashop.com/en/promotions-gifts/41771-smart-popup-newsletter-popup.html.

It has worked great for years, but with the latest bleeding edge update, we now get the below error. I checked with the developer and he, as I expected, will only provide minimal support since this is not actually prestashop. He did advise that this issue is usually caused by a permissions issue. His actual words "file permissions, be sure that all your files are accesible, normally 0755 for directories and 0644 for files."

My question is likely for @datakick, but is there something related to newsletter subscriptions that would have changed in the latest bleeding edge versions and would have caused this issue? If so, ho would I resolve it?

I appreciate the help.

  image.png.07f50ccfbf26bfaa4525fc77c3668b4f.png

Posted (edited)

And this is the snippet of code driving the error message:

<?php
/**
 * Smart Popup (Newsletter Popup)
 *
 * @author    Rolige <www.rolige.com>
 * @copyright Since 2011 Rolige - All Rights Reserved
 * @license   Proprietary and confidential
 */

require_once dirname(__FILE__) . '/../../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../../init.php';
require_once dirname(__FILE__) . '/../rg_smartpopup.php';
 
$module = new Rg_SmartPopup();
 
if ($module->active && $module->public_key == Tools::getValue('public_key')) {
    $json = Tools::file_get_contents('php://input');
    $data = json_decode($json, true);
 
    if (!$data || !isset($data['rgsp_id']) || !isset($data['rgsp_token'])) {
        RgSpTools::log('Subscription: Data error', $data);
 
        die(json_encode([
            'result' => RgSpSubscriber::RESPONSE_ERROR,
            'msg' => $module->l('An unexpected error occurred, please try again later.', 'subscription'),
        ]));
    }

 

 

Edited by x97wehner
Posted
5 hours ago, x97wehner said:

RgSpTools::log('Subscription: Data error', $data);

Check what was logged from this line.

If nothing clear, try to change $data for $data['rgsp_id'] and $data['rgsp_token'], or even $json, in the log calling.

Posted
On 9/5/2024 at 1:01 AM, datakick said:

the server responded with 500 error code. Check for errors in collectlogs module.

I was able to validate that this is only happening on bleeding edge. I flipped it back to 1.5 stable and it works perfectly. Update to the latest bleeding edge, and I get the same issue. There is nothing being logged in the tb /log directory or on the collectlogs module. This has only been an issue since I updated to bleeding edge about two weeks ago and remains an issue with the latest update. It appears to be a bug in the latest tb updates. Any idea what could be causing it @datakick?

 

Posted

@x97wehner Without error logs, it's not possible to say what is causing this. The module probably catch the exception, and returns this generic error message. You will have to modify the place where this happens, and add some additional logging -- display exception to output, or re-throw it and let collectlogs catch and log it. Or something similar.

 

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
×
×
  • Create New...