Skip to content
Snippets Groups Projects

Add report for paragraphs entity types.

2 unresolved threads

Closes #3503885

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Steve Wirt
  • Overall this is looking great. Thank you. I only see two issues that would prevent me from merging this.

  • Steve Wirt requested changes

    requested changes

  • 154 }
    155
    156 /**
    157 * Gets the count of published nodes.
    158 *
    159 * @return array
    160 * The array of bundles with a published count.
    161 */
    162 protected function getBundlePublishedCount() {
    163 if ($this->entityTypeExists(self::ENTITY_TYPE)) {
    164 $paragraph_types = $this->entityTypeManager->getStorage(self::ENTITY_TYPE)->loadMultiple();
    165 foreach ($paragraph_types as $paragraph_type) {
    166 $type_id = $paragraph_type->id();
    167 // Query to count the number of paragraphs of this type.
    168 $query = $this->entityTypeManager->getStorage('paragraph')->getQuery();
    169 $query->condition('type', $type_id)->accessCheck(TRUE);
    • Suggested change
      169 $query->condition('type', $type_id)->accessCheck(TRUE);
      169 $query->condition('type', $type_id)->accessCheck(FALSE);

      This needs to be FALSE so that the report shows the entire site structure, not just the structure that the user looking at the report has permission to see. There is no security risk here because we are not granting access to the specific content, just listing the type and counting the instances.

    • Nidhi Patadia changed this line in version 2 of the diff

      changed this line in version 2 of the diff

    • Please register or sign in to reply
  • Steve Wirt requested review from @swirtMiles

    requested review from @swirtMiles

  • Nidhi Patadia added 1 commit

    added 1 commit

    • c3451c5e - Add report for paragraphs entity types

    Compare with previous version

  • Steve Wirt
    Steve Wirt @swirtMiles started a thread on commit c3451c5e
  • 492 492 * TRUE if the entity type is defined, FALSE otherwise.
    493 493 */
    494 494 protected function entityTypeExists(string $entity_type_name): bool {
    495 return $this->entityTypeManager->hasDefinition("block_content");
    495 return $this->entityTypeManager->hasDefinition($entity_type_name);
  • Steve Wirt
  • Steve Wirt approved this merge request

    approved this merge request

  • Steve Wirt added 1 commit

    added 1 commit

    • aa0cf5c5 - Instantiate $paragraph_type_counts

    Compare with previous version

  • Steve Wirt reset approvals from @swirtMiles by pushing to the branch

    reset approvals from @swirtMiles by pushing to the branch

  • Steve Wirt added 1 commit

    added 1 commit

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading