-
Notifications
You must be signed in to change notification settings - Fork 15
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
IBX-2937: Added new relation starting location options #432
Conversation
2ccd900
to
72b4c37
Compare
5451a3f
to
0efa2e5
Compare
0efa2e5
to
530ce4d
Compare
src/bundle/Resources/views/themes/admin/content_type/relation_list_form_fields.html.twig
Show resolved
Hide resolved
@@ -303,7 +303,7 @@ const UniversalDiscoveryModule = (props) => { | |||
}, [currentView]); | |||
|
|||
useEffect(() => { | |||
if (!props.startingLocationId || props.startingLocationId === 1) { | |||
if (!props.startingLocationId || props.startingLocationId === 1 || props.startingLocationId === props.rootLocationId) { |
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.
You should also update the dependencies of this hook (line :324).
Dependencies are responsible for establishing what properties will cause the useEffect
hook to recalculate. In this case you're adding props.rootLocationId
as part of this condition, so if it ever changes, it should cause useEffect
to re-apply, just as props.startingLocationId
does.
Although, from what I see, other dependencies are also missing (like currentView
).
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.
👍 for PHP code 😅
bb3bae5
to
2b27614
Compare
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.
Tested all the PRs together on relation and relationlist fieldtypes, looks good!
QA Approved
Not a stand alone PR.
Requires:
Checklist:
$ composer fix-cs
)