Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Support for Singletons #31

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

magnumrocha
Copy link

Add Moderation support for Singletons registers

@pauloamgomes
Copy link
Owner

Hi @magnumrocha , thanks for your PR! That's a great addition that never had the time to implement. I'm not updating this addon for a long time and therefore I'll need some time to review and merge the PR.

Copy link
Owner

@pauloamgomes pauloamgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In overall seems doing the job, the comments are all very minor, but keep in mind I'm not actively looking to this addon (it was probably some years last time looked into the code).

@@ -1,4 +1,4 @@
<?php
<?php
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space?

if (!isset($collections[$data['_collection']])) {
$collection = $this->app->module('collections')->collection($data['_collection']);
$collections[$data['_collection']] = $collection;
foreach ($results['active'] as $result) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably could we decouple better singletons from collections functionality, and reduce the size of the run function

@@ -34,7 +34,7 @@
$options['fields'][$field_name] = 1;
}

$app->trigger("moderation.find.before", [$name, &$options]);
$app->trigger("moderation.collections.find.before", [$name, &$options]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a breaking change, would be possible to maintain the moderation.find.before hook and then call the functionality depending on what we have there? its fine on having the new hooks, just concerned on removing the existing one as any addons that rely on it will break

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants