Something is setting Field::flagSystemOverride on non-system fields
Short description of the issue
Sorry that this issue description isn't more specific but I don't know what is causing it.
When I want to get user-created fields (i.e. non-system fields) I look for fields that don't have any flags set.
$non_system_fields = $fields->find("flags=0");
For a while now I've noticed that some non-system fields are being missed, and on investigation I find that these fields have Field::flagSystemOverride set. The thing is, I've never intentionally set this flag on these fields so I think it must be something in the core that's doing it.
Here's an example from an almost completely clean PW 3.0.238 installation with the blank profile.
All I've done is:
- Install TracyDebugger
- Install ModuleSettingsImportExport (so I can import my preferred Tracy settings)
- Turn $config->debug on
- Turn $config->advanced on (maybe the culprit?)
- Create a "text_1" field and add it to the basic page template.
Setup/Environment
- ProcessWire version: 3.0.238
I can confirm Robin's findings. It looks like these lines in ProcessField.module set an override flag:
} else if($name === 'system' && $config->advanced) {
if(!$input->post('system')) {
$this->field->flags = $this->field->flags | Field::flagSystemOverride;
$this->field->flags = $this->field->flags & ~Field::flagSystem;
} else {
$this->field->flags = $this->field->flags | Field::flagSystem;
}
continue;
Thanks @Toutouwai @matjazpotocnik I've pushed a fix for this.
Thanks