Skip to content

Commit

Permalink
Merge pull request #312 from moreonion/m2t-extend-mp-csv-hack
Browse files Browse the repository at this point in the history
Match to target: Extend the hard-coded MP export to other content types
  • Loading branch information
torotil committed Dec 6, 2022
2 parents a7c7732 + f21a856 commit 9716454
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions campaignion_email_to_target/webform.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use \Drupal\campaignion_action\Loader;
use \Drupal\campaignion_email_to_target\Action;
use \Drupal\campaignion_email_to_target\Message;
use \Drupal\little_helpers\ArrayConfig;
use \Drupal\little_helpers\Webform\Webform;
Expand Down Expand Up @@ -118,9 +119,11 @@ function _webform_show_single_target_e2t_selector($nid) {
return FALSE;
}
$return = FALSE;
if (($node = node_load($nid)) && $node->type == 'email_to_target') {
$action = Loader::instance()->actionFromNode($node);
$return = $action->getOptions()['dataset_name'] == 'mp';
$loader = Loader::instance();
if (($node = node_load($nid)) && ($action = $loader->actionFromNode($node))) {
if ($action instanceof Action) {
$return = $action->getOptions()['dataset_name'] == 'mp';
}
}
$static_cache[$nid] = $return;
return $return;
Expand Down

0 comments on commit 9716454

Please sign in to comment.