You are here

public function ParserBase::feedFormValidate in Feeds XPath Parser 8

Overrides parent::feedFormValidate().

If the values of this source are the same as the base config we set them to blank so that the values will be inherited from the importer defaults.

@todo Do this differently.

File

lib/Drupal/feeds_xpathparser/ParserBase.php, line 408
Contains \Drupal\feeds_xpathparser\ParserBase.

Class

ParserBase
Base class for the HTML and XML parsers.

Namespace

Drupal\feeds_xpathparser

Code

public function feedFormValidate(array $form, array &$form_state, FeedInterface $feed) {
  if ($this->config['allow_override']) {
    $config = $this
      ->getConfig();
    $allow_override = $config['allow_override'];
    $values = $form_state['values']['parser'];
    unset($config['allow_override']);
    $this
      ->kSort($values);
    $this
      ->kSort($config);
    if ($values === $config || !$allow_override) {
      $form_state['values']['parser'] = array();
      return;
    }
    $parser_form_state = array();
    $parser_form_state['values'] =& $form_state['values']['parser'];
    $parser_form =& $form['parser'];
    $this
      ->validateForm($parser_form, $parser_form_state);
  }
}