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

Domain config ui #434

Merged
merged 187 commits into from Jun 18, 2020
Merged

Domain config ui #434

merged 187 commits into from Jun 18, 2020

Conversation

agentrickard
Copy link
Owner

The new branch for Domain Config UI.

@davidgrayston
Copy link
Contributor

I started to move this into a separate domain_admin_ui module last year, which was abandoned in the end.

Something we may need to include is a cache context for the current selected domain, something like this: https://github.com/davidgrayston/domain_admin_ui/blob/8.x-1.x/src/Cache/Context/SelectedDomain.php

@davidgrayston
Copy link
Contributor

Happy to issue a PR to this branch if you feel this cache context is needed

@agentrickard
Copy link
Owner Author

I don't think we need the cache context because the core url.site context is sufficient. In other places in the code, that's what we use, for instance in https://github.com/agentrickard/domain/blob/8.x-1.x/domain/src/Plugin/Condition/Domain.php#L139

@davidgrayston
Copy link
Contributor

Ok, just thought I’d mention as this implementation is switching the config based on a session variable (URL won’t change)

@agentrickard
Copy link
Owner Author

I hadn't considered that. However, I don't think admin forms are cached except by session, so I don't think we have any issues.

We could write a test that has two accounts edit the same form to see if caching is an issue.

@agentrickard
Copy link
Owner Author

agentrickard commented Jun 28, 2018

There are some questions in the TODO here -- 9865bd7 -- that could use review.

* @param string $name
* The configuration name.
*/
protected function isAllowedDomainConfig(string $name) {
Copy link

Choose a reason for hiding this comment

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

This is PHP7 only code, the string type hint should be removed

Copy link
Contributor

Choose a reason for hiding this comment

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

Type hinting (in this form) has been in PHP since version 5

Copy link

Choose a reason for hiding this comment

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

Most type hints are supported but not 'string' as primitive type. That one is added in php 7.0, see http://php.net/manual/en/migration70.new-features.php

Copy link

Choose a reason for hiding this comment

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

BTW: I noticed this because I got a hard failure on my php 5.6 setup. So I'm 100% sure ;).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, was using PHP 7 for so long, I missed that. Fair comment.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, we don't type hint strings anywhere else. But oddly this doesn't fail here -- https://travis-ci.org/agentrickard/domain/builds/398266990?utm_source=github_status&utm_medium=notification

@BramG
Copy link

BramG commented Oct 4, 2018

Module works perfectly btw :)

@agentrickard agentrickard merged commit 2fb53e2 into 8.x-1.x Jun 18, 2020
@agentrickard agentrickard deleted the domain-config-ui branch June 18, 2020 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants