Error: Object of class GetExtendedList in Signup Forms admin page

Created on 21 April 2023, over 1 year ago

Problem/Motivation

Trying to access the Signup Forms admin list after I add a form, I get this error page:

Error: Object of class GetExtendedList could not be converted to string in check_plain() (row 1908 of /var/www/html/web/includes/bootstrap.inc).

Steps to reproduce

Install the module and add the API key.
Add a new Signup Form. When you save you get the error.

Proposed resolution

Debugging I found in row 52 of sendinblue_signup.ui_controller.inc the l() function (the one to create links) is used but the first argument $list_name isn't a text but a list object just loaded from getListNameById in the previous line.

      $list_name = SendinblueManager::getListNameById($signup->settings['subscription']['settings']['list']);
      $list_labels[] = l($list_name, 'https://my.sendinblue.com/users/list/id/?utm_source=drupal_plugin&utm_medium=plugin&utm_campaign=module_link' . $signup->settings['subscription']['settings']['list']);

My suggestion is to add a getName() method to line 51, changing it to:

      $list_name = SendinblueManager::getListNameById($signup->settings['subscription']['settings']['list'])->getName();
      $list_labels[] = l($list_name, 'https://my.sendinblue.com/users/list/id/?utm_source=drupal_plugin&utm_medium=plugin&utm_campaign=module_link' . $signup->settings['subscription']['settings']['list']);

Attaching patch.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇹Italy nessunluogo Tremestieri Etneo (CT)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024