Skip to content
Snippets Groups Projects

Issue #3327104 by snap_x, generalredneck, Suresh Prabhu Parkala,...

1 file
+ 11
7
Compare changes
  • Side-by-side
  • Inline
+ 11
7
@@ -3,7 +3,7 @@
namespace Drupal\paragraphs_report;
use Drupal\Core\Config\ConfigFactoryInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Drupal\Core\Http\RequestStack;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Xss;
@@ -229,7 +229,7 @@ class ParagraphsReport {
'error_message' => $this->t('Batch failed.'),
'operations' => $operations,
'finished' => 'batch_save',
'file' => \Drupal::service('extension.list.module')->getPath('paragraphs_report') . '/paragraphs_report.batch.inc',
'file' => drupal_get_path('module', 'paragraphs_report') . '/paragraphs_report.batch.inc',
];
return $batch;
}
@@ -304,7 +304,6 @@ class ParagraphsReport {
}
$query = $this->entityTypeManager->getStorage('node');
$nids = $query->getQuery()
->accessCheck(TRUE)
->condition('type', $contentTypes, 'IN')
->execute();
return $nids;
@@ -471,14 +470,19 @@ class ParagraphsReport {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
public function insertParagraphs(EntityInterface $entity) {
if ($this->checkWatch($entity)) {
// Send node to get parsed for paragraph fields/sub-fields.
$json = Json::decode($this->paraSettings->get('report') ?? '');
public function insertParagraphs(EntityInterface $entity) {
if ($this->checkWatch($entity)) {
// Send node to get parsed for paragraph fields/sub-fields.
$json = Json::decode($this->paraSettings->get('report') ?? '');
// Check if $json is an array before passing it to getParasFromNid.
if (is_array($json)) {
$updated = $this->getParasFromNid($entity->id(), $json);
$this->configSaveReport($updated);
}
}
}
/**
* Update report data with paragraph changes in node.
Loading