-
Notifications
You must be signed in to change notification settings - Fork 2
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
[SDPAP-8290]added hook update to apply new content type to existing sites #122
[SDPAP-8290]added hook update to apply new content type to existing sites #122
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One query @yeniatencio
|
||
if (!empty($temp)) { | ||
$content_types_options = $temp + $content_types_options; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to be a pain and ask why this code is here... it doesn't make a lot of sense to me just by looking at it, is it reordering the types for the checkboxes or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krakerag , part of the acceptance criteria is to have the checkboxes in this order:
Order of checkboxes:
Landing page
Publication (new)
News
Event (new)
That's why I have to reorder them as by default they are ordered alphabetically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a complicated piece of code to assign them when we know the order, we should just set the order and move on, rather than doing a temp assignment to an array and add it to another array etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a complicated piece of code to assign them when we know the order, we should just set the order and move on, rather than doing a temp assignment to an array and add it to another array etc.
@krakerag , you mean, leave them by default? Alphabetically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I mean literally just set them in the right order so the code is clear
['landing_page', 'publication', 'news', 'event']
if ($config) { | ||
$config->set('content.field_content_collection_config.settings.content.internal.contentTypes.allowed_values', $allowed_content_types); | ||
$config->save(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
JIRA issue:
https://digital-vic.atlassian.net/browse/SDPAP-8290
Changed
Note:
Added new and publication content type to content collection in baywatch dpc-sdp/baywatch#86
Testing link: https://nginx-php.pr-365.content-reference-sdp-vic-gov-au.sdp4.sdp.vic.gov.au/
Screenshots