CMP extra : properties not created

There is something I don’t understand with CMP extra with the “example” project:
Property set are created with their description but not the properties.

“data” folder contains properties.snippet1.snippet.php and properties.snippet2.snippet.php files with the properties definition:

$properties = array(
array(
‘name’ => ‘property1’,
‘desc’ => ‘mc_propertyset1_property1_desc’,
‘type’ => ‘combo-boolean’,
‘options’ => ‘’,
‘value’ => ‘1’,
‘lexicon’ => ‘mycomponent:properties’,
),
array(
‘name’ => ‘property2’,
‘desc’ => ‘mc_propertyset1_property2_desc’,
‘type’ => ‘textfield’,
‘options’ => ‘’,
‘value’ => ‘Value of property 2’,
‘lexicon’ => ‘mycomponent:properties’,
),
array(
‘name’ => ‘property4’,
‘desc’ => ‘mc_propertyset1_property4_desc’,
‘type’ => ‘textfield’,
‘options’ => ‘’,
‘value’ => ‘This property is not in the default properties’,
‘lexicon’ => ‘mycomponent:properties’,
),
);

but doesn’t appear:

return $properties;

Help welcome !

I’ve confirmed that with the Example project, MyComponent does not create the properties properly. It used to, so maybe something has changed.

I’ll look into it when I have a chance.

What version of MODX are you running?

Thanks for reporting this.

OK, think I’ve figured this out. A long time ago, snippet properties were transported in separate files, like the one you found. Also a long time ago, that was changed to having them transported in the snippet file, but the file you found wasn’t deleted, even though it’s no longer used and no longer included in the MyComponent files.

The reason for the change was that it was easier, more efficient, and a lot less error-prone, to create the default snippet properties in the Manager, rather than trying to specify them all in the config. file.

So, if you create properties for either of the example snippets in the Manager. They will be exported to the snippet file when you run export objects and will automatically be included in the build.

thanks you for your reply !