mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 08:44:46 +02:00
Fix issue processwire/processwire-issues#2101
This commit is contained in:
@@ -22,8 +22,6 @@ $formAction = htmlentities($formAction, ENT_QUOTES, "UTF-8");
|
||||
|
||||
<link type='text/css' href='wire/modules/AdminTheme/AdminThemeUikit/uikit-pw/pw.min.css' rel='stylesheet' />
|
||||
<link type='text/css' href='wire/templates-admin/styles/AdminTheme.css' rel='stylesheet' />
|
||||
<link type='text/css' href='wire/modules/AdminTheme/AdminThemeUikit/themes/default/admin.css' rel='stylesheet' />
|
||||
<link type='text/css' href='wire/modules/AdminTheme/AdminThemeUikit/themes/default/install.css' rel='stylesheet' />
|
||||
<link type='text/css' href='wire/templates-admin/styles/font-awesome/css/font-awesome.min.css' rel='stylesheet' />
|
||||
|
||||
<style type='text/css'>
|
||||
|
@@ -867,18 +867,38 @@ class ProcessField extends Process implements ConfigurableModule {
|
||||
protected function buildEditFormAlert() {
|
||||
|
||||
$modules = $this->wire()->modules;
|
||||
$languages = $this->wire()->languages;
|
||||
|
||||
$this->field->type->getDatabaseSchema($this->field); // may add to trackGets, so we include it (i.e. FieldtypeFile and fileSchema)
|
||||
$gets = $this->field->trackGets();
|
||||
$xkeys = array();
|
||||
$numRows = 0;
|
||||
$checkLabel = $this->_('Check field reported:') . ' ';
|
||||
$languageIds = [];
|
||||
|
||||
if($languages) {
|
||||
foreach($languages as $language) {
|
||||
if(!$language->isDefault()) $languageIds[$language->id] = $language->id;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($gets)) {
|
||||
foreach($this->field->data as $key => $value) {
|
||||
if(in_array($key, $gets)) continue;
|
||||
if($this->form->getChildByName($key)) continue; // confirm there isn't a field with the name
|
||||
if($key === '_lazy') continue;
|
||||
|
||||
if(count($languageIds) && ctype_digit(substr($key, -4))) {
|
||||
// skip multi-language field that maps to an active language and property
|
||||
if(preg_match('/^(.+)(' . implode('|', $languageIds) . ')$/', $key, $matches)) {
|
||||
$property = $matches[1];
|
||||
$languageId = (int) $matches[2];
|
||||
if(isset($languageIds[$languageId]) && $this->field->get($property) !== null) {
|
||||
// multi-language property that also has a corresponding default-language property
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
$xkeys[] = $key;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user