Issue #3373258 by a.dmitriiev, leymannx: Allow to select reference method in...
9 unresolved threads
Merge request reports
Activity
110 181 ], 111 182 ]; 112 183 184 return $form; 185 } 186 187 /** 188 * Form element validation handler; Invokes selection plugin's validation. 189 * 190 * @param array $form 191 * The form where the settings form is being included in. 192 * @param \Drupal\Core\Form\FormStateInterface $form_state 193 * The form state of the (entire) configuration form. 194 */ 195 public static function fieldSettingsFormValidate(array $form, FormStateInterface $form_state) { changed this line in version 4 of the diff
193 * The form state of the (entire) configuration form. 194 */ 195 public static function fieldSettingsFormValidate(array $form, FormStateInterface $form_state) { 196 /** @var \Drupal\Core\Field\FieldDefinitionInterface $field */ 197 $field = $form_state->getFormObject()->getEntity(); 198 $field->getFieldStorageDefinition()->setSetting('target_type', 'node'); 199 $handler = \Drupal::service('plugin.manager.entity_reference_selection')->getSelectionHandler($field); 200 $handler->validateConfigurationForm($form, $form_state); 201 } 202 203 /** 204 * Render API callback: Processes the field settings form. 205 * 206 * @see static::fieldSettingsForm() 207 */ 208 public static function fieldSettingsAjaxProcess($form, FormStateInterface $form_state) { changed this line in version 4 of the diff
203 /** 204 * Render API callback: Processes the field settings form. 205 * 206 * @see static::fieldSettingsForm() 207 */ 208 public static function fieldSettingsAjaxProcess($form, FormStateInterface $form_state) { 209 static::fieldSettingsAjaxProcessElement($form, $form); 210 return $form; 211 } 212 213 /** 214 * Adds the field settings to AJAX form elements. 215 * 216 * @see static::fieldSettingsAjaxProcess() 217 */ 218 public static function fieldSettingsAjaxProcessElement(&$element, $main_form) { changed this line in version 4 of the diff
225 } 226 227 foreach (Element::children($element) as $key) { 228 static::fieldSettingsAjaxProcessElement($element[$key], $main_form); 229 } 230 } 231 232 /** 233 * Render API callback that moves entity reference elements up a level. 234 * 235 * The elements (i.e. 'handler_settings') are moved for easier processing by 236 * the validation and submission handlers. 237 * 238 * @see _entity_reference_field_settings_process() 239 */ 240 public static function formProcessMergeParent($element) { changed this line in version 4 of the diff
237 * 238 * @see _entity_reference_field_settings_process() 239 */ 240 public static function formProcessMergeParent($element) { 241 $parents = $element['#parents']; 242 array_pop($parents); 243 $element['#parents'] = $parents; 113 244 return $element; 114 245 } 115 246 247 /** 248 * Ajax callback for the handler settings form. 249 * 250 * @see static::fieldSettingsForm() 251 */ 252 public static function settingsAjax($form, FormStateInterface $form_state) { changed this line in version 4 of the diff
115 246 247 /** 248 * Ajax callback for the handler settings form. 249 * 250 * @see static::fieldSettingsForm() 251 */ 252 public static function settingsAjax($form, FormStateInterface $form_state) { 253 return NestedArray::getValue($form, $form_state->getTriggeringElement()['#ajax']['element']); 254 } 255 256 /** 257 * Submit handler for the non-JS case. 258 * 259 * @see static::fieldSettingsForm() 260 */ 261 public static function settingsAjaxSubmit($form, FormStateInterface $form_state) { changed this line in version 4 of the diff
349 356 return $element; 350 357 } 351 358 359 /** 360 * Returns the options for the match operator. 361 * 362 * @return array 363 * List of options. 364 */ 365 protected function getMatchOperatorOptions() { changed this line in version 4 of the diff
16 */ 17 protected $defaultTheme = 'stark'; 18 19 /** 20 * {@inheritdoc} 21 */ 22 protected function setDatabaseDumpFiles() { 23 $this->databaseDumpFiles = [ 24 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-9.4.0.filled.standard.php.gz', 25 ]; 26 } 27 28 /** 29 * Tests update hook setting handler for field type. 30 */ 31 public function testLinkFieldTypeUpdate() { changed this line in version 4 of the diff
32 $config = $this->config('field.field.node.test_content_type.field_test_5'); 33 $this->assertEmpty($config->get('settings.handler')); 34 $this->assertEmpty($config->get('settings.handler_settings')); 35 36 // Run updates. 37 $this->runUpdates(); 38 39 $config = $this->config('field.field.node.test_content_type.field_test_5'); 40 $this->assertSame('default', $config->get('settings.handler')); 41 $this->assertIsArray($config->get('settings.handler_settings')); 42 } 43 44 /** 45 * Tests update hook setting handler for field type. 46 */ 47 public function testLinkWidgetMatchSettingsUpdate() { changed this line in version 4 of the diff
added 1305 commits
-
a670f409...902eab09 - 1304 commits from branch
project:11.x
- 8407cd38 - Merge branch '11.x' into '3373258-allow-to-select'
-
a670f409...902eab09 - 1304 commits from branch
Please register or sign in to reply