Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change TypeConditionRule to allow multiple selections of entry types #11124

Merged
merged 15 commits into from
May 11, 2022

Conversation

nfourtythree
Copy link
Contributor

Description

Currently, the entry type condition will only allow the ability to define one entry type for its value.

This PR adjusts the functionality so that the TypeConditionRule becomes multi selectable allow the ability to specify in/not in a list of entry types. This gives a little more power to the rule.

@nfourtythree nfourtythree requested review from brandonkelly and a team as code owners May 6, 2022 13:51
@brandonkelly brandonkelly changed the base branch from develop to 4.1 May 7, 2022 10:06
@brandonkelly
Copy link
Member

There’s no way we can know all of the places an entry condition may be used, so rather than trying to update existing configs with a migration, the condition rule should just be able to handle an outdated configuration, e.g. by normalizing the config array from the constructor.

@nfourtythree
Copy link
Contributor Author

@brandonkelly have done the following:

  • Removed the migration
  • Handle the old settings in the init
  • Which required an update to Conditions::createConditionRule() to pass the attributes during the creation of the object.

I also merged develop into this branch to make sure it was up to date, but looks like develop needs merging into 4.1.

@brandonkelly
Copy link
Member

If you move the config normalization to the constructor, you should be able to remove the deprecated properties entirely, right?

@nfourtythree
Copy link
Contributor Author

If you move the config normalization to the constructor, you should be able to remove the deprecated properties entirely, right?

If we remove those and someone was accessing those directly you would get an error? I was trying to be overly cautious and make sure it wasn't a breaking change.

Granted I probably still could have done it in the constructor which is where I started with it until I realised we need this fix.

@brandonkelly
Copy link
Member

Highly doubt anyone is referencing those properties; it should be safe to fully remove.

@nfourtythree
Copy link
Contributor Author

@brandonkelly works for me! Updates pushed.

@brandonkelly brandonkelly merged commit f39912f into 4.1 May 11, 2022
@brandonkelly brandonkelly deleted the feature/allow-multiple-types-type-condition-rule branch May 11, 2022 03:38
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.

2 participants