Skip to content

Settings no longer accessible via js in 2.7.1 #21

@ChrstnMgcn

Description

@ChrstnMgcn

In a custom renderer for Collections, we've had a reference to a Cross Context Setting key of "site_folder" for several years.

collections.renderer.site_image = function(value, metaData, record, rowIndex, colIndex, store) 
{
    if (value)
    {
        
        if (value.includes("http")) // used for images with full url
        {
            var imgURL = value;
        }
        else
        {
            imgURL = '/sites/' + **MODx.config['site_folder']** + '/' + value;
        }
        console.log(MODx);    
        //return imgURL;
         return '<img src="' + imgURL + '" width="64">';
    }
};

After the update to 2.7.1 it appears that the value is no longer accessible in the MODx.config array
(or anywhere in the MODx array for that matter) and so the thumbnails are not being rendered. The only thing that changed was the MODX version. Collections and Cross Context Settings are both up-to-date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions