I am getting an SQL error when displaying some mailing lists in the users profile page, caused by getMailingLists() function;
Snippet of my code;
{% set userContact = craft.campaign.contacts.userId(currentUser.id).one() %}
{% set userMailingLists = userContact ? userContact.getMailingLists() : [] %}
Error:
Database Exception – [yii\db\Exception](https://www.yiiframework.com/doc-2.0/yii-db-exception.html)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'title' in 'order clause'
The SQL being executed was: SELECT `mailingListId`
FROM (SELECT `campaign_contacts_mailinglists`.*
FROM `campaign_contacts_mailinglists`
INNER JOIN `elements` `contactElement` ON `contactElement`.`id` = `contactId`
INNER JOIN `elements` `mailingListElement` ON `mailingListElement`.`id` = `mailingListId`
WHERE (`contactElement`.`draftId` IS NULL) AND (`contactElement`.`dateDeleted` IS NULL) AND (`mailingListElement`.`dateDeleted` IS NULL)) `subquery`
WHERE `contactId`=40332
ORDER BY `title`
Bug Report
I am getting an SQL error when displaying some mailing lists in the users profile page, caused by getMailingLists() function;
Snippet of my code;
Error:
Plugin Version
2.15.1
Craft CMS Version
4.8.9
PHP Version
No response