Skip to content

auditExclude merge versus replace#969

Open
gravitymedianet wants to merge 6 commits into
owen-it:masterfrom
gravitymedianet:master
Open

auditExclude merge versus replace#969
gravitymedianet wants to merge 6 commits into
owen-it:masterfrom
gravitymedianet:master

Conversation

@gravitymedianet

Copy link
Copy Markdown

Allows for merging the local auditExclude values into the global exclude list instead of replacing it.

…lude

Allows for merging the model's audit exclude with the config default exclude list, instead of replacing it.
When getting the auditExclude values, check for global config  audit.exclude_merge property and merge if enabled, instead of replace. Otherwise, check locally at the model level.
Comment thread src/Auditable.php
Simplify the merge condition check
Comment thread src/Auditable.php
if (
Config::get('audit.exclude_merge', false) ||
($this->auditExcludeMerge ?? false)
$this->auditExcludeMerge ?? Config::get('audit.exclude_merge', false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems that you decided not to follow the instructions

the false is not necessary, the default is null and the null on a if is already false

if ($this->auditExcludeMerge ?? Config::get('audit.exclude_merge')) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Apologies, now I understand. Code updated.

@parallels999 parallels999 Sep 19, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code updated.

the 'false' is still there 😕

@willpower232 willpower232 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as mentioned by @parallels999, the , false) is not necessary

it would also be good to see a few tests for the different combinations of the auditExcludeMerge property and the config value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants