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

Added paragraph about siteaccess scopes are merged #2475

Open
wants to merge 3 commits into
base: 4.6
Choose a base branch
from

Conversation

vidarl
Copy link
Contributor

@vidarl vidarl commented Aug 21, 2024

Question Answer
JIRA Ticket N/A
Versions 3.3, 4.6
Edition Content/Headless,

Added paragraph about settings for the different siteaccess scopes are merged

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

@vidarl vidarl requested a review from a team August 21, 2024 06:53
@mnocon
Copy link
Contributor

mnocon commented Aug 21, 2024

Thank you Vidar! So for scalar values (string, int) the "higher level" scope simply overwrites the lower levels - but in terms of arrays they get merged together?

@mnocon mnocon requested review from a team and removed request for a team August 21, 2024 07:04
@vidarl
Copy link
Contributor Author

vidarl commented Aug 21, 2024

Thank you Vidar! So for scalar values (string, int) the "higher level" scope simply overwrites the lower levels - but in terms of arrays they get merged together?

That is correct

@alongosz
Copy link
Member

Thank you Vidar! So for scalar values (string, int) the "higher level" scope simply overwrites the lower levels - but in terms of arrays they get merged together?

That is correct

This is more complicated than that. It depends on specific set of settings and their nesting level. In case of languages this is true, but for each case I'd check the container. We had and probably still have some config merging issues in some places.

@alongosz alongosz requested a review from a team August 27, 2024 09:12
@vidarl
Copy link
Contributor Author

vidarl commented Feb 12, 2025

@alongosz already approved this one, so I assume it can be merged?

Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

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

Thank you Vidar!

A couple suggestions from me to make it simpler - I'd also mention the ibexa:debug:config command to make sure people know how to check this themselves

languages: ['ger-DE']
```

The language setting for the `de` siteaccess will in this case be `['ger-DE','eng-GB']`, not `['ger-DE']`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The language setting for the `de` siteaccess will in this case be `['ger-DE','eng-GB']`, not `['ger-DE']`.
The final value of the `languages` setting for the `de` SiteAccess is `['ger-DE','eng-GB']`, not `['ger-DE']`.
You can always check the final values by running the `ibexa:debug:config` console command.
For this example, the command looks like this:
``` bash
php bin/console ibexa:debug:config --siteaccess=de languages
```

Comment on lines +138 to +139
Be aware of the fact that configurations in the different scopes are merged, not overwritten. This is important to have
in mind when dealing with arrays:
Copy link
Contributor

@mnocon mnocon Feb 12, 2025

Choose a reason for hiding this comment

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

Suggested change
Be aware of the fact that configurations in the different scopes are merged, not overwritten. This is important to have
in mind when dealing with arrays:
When working with arrays, configurations from different scopes are merged together.
See the following example:

(modified to take into account Julita's suggestion from below)

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a small remark: "See the following (...)" - new line.

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

Successfully merging this pull request may close these issues.

5 participants