vaersaagod/seomate

Error when i try use Multi-select field

bcwebdominik opened this issue · 1 comments

When i try to use multiselect field (that field is nested in matrix field) in seomate config file i get below error:

PHP Recoverable Error – yii\base\ErrorException
Object of class craft\fields\data\MultiOptionsFieldData could not be converted to string

My code snippet:

    'fieldProfiles' => [
        'standard' => [
            'title' => ['seoFields:settings.alternativeTitle', 'title'],
            'description' => ['seoFields:settings.description'],
            'image' => ['seoFields:settings.image'],
            'keywords' => ['seoFields:settings.keywords'], 
            'robots' => ['seoFields:settings.robotsMulti'], 

        ],
    ],

This isn't something we can fix in SEOMate – a Multi Select field essentially returns an array, so SEOMate wouldn't know what value to print. You'd get the same error if you tried to render the field in Twig like a string (i.e. {{ seoFields.settings.robotsMulti }}).