Problem/Motivation

We need to add hasConfigSchema method.

Proposed resolution

Issue patch!!!

Remaining tasks

User interface changes

API changes

Files: 
CommentFileSizeAuthor
#13 2097259-has-config-schema-13.patch3.45 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 58,583 pass(es). View
#13 2097259-diff-12-13.txt496 bytesvijaycs85
#12 2097259-has-config-schema-12.patch3.43 KBvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 58,730 pass(es). View
#12 2097259-diff-9-12.txt1.96 KBvijaycs85
#9 2097259-has-config-schema-9.patch2.37 KBtstoeckler
PASSED: [[SimpleTest]]: [MySQL] 58,725 pass(es). View
#8 2097259-has-config-schema-8.patch2.35 KBtstoeckler
FAILED: [[SimpleTest]]: [MySQL] 58,717 pass(es), 1 fail(s), and 0 exception(s). View
#8 2097259-has-config-schema-interdiff-5-8.txt1.74 KBtstoeckler
#5 2097259-has-config-schema-5.patch2.35 KBtstoeckler
FAILED: [[SimpleTest]]: [MySQL] 58,673 pass(es), 1 fail(s), and 0 exception(s). View
#5 2097259-has-config-schema-interdiff-2-5.txt2.15 KBtstoeckler
#2 2097259-has-config-schema-2.patch908 bytesvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 58,564 pass(es). View
#1 2097259-has-config-schema-1.patch766 bytesvijaycs85
PASSED: [[SimpleTest]]: [MySQL] 58,953 pass(es). View

Comments

vijaycs85’s picture

Status: Active » Needs review
FileSize
766 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,953 pass(es). View

Initial patch...

vijaycs85’s picture

FileSize
908 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,564 pass(es). View

Few documentation improvements as per @tstoeckler.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +blocker

Awesome, thanks @vijaycs85!

Also tagging this as blocker. We currently have this as a procedural method in config_translation but A) this is in no way specific to config_translation and B) procedural function --

So let's get this out of the way.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

You know this needs tests. A simple one checking a config schema that does not exist and one that does would be great. I think we may have in fact some test for a similar thing that can be extended.

tstoeckler’s picture

Status: Needs work » Needs review
FileSize
2.15 KB
2.35 KB
FAILED: [[SimpleTest]]: [MySQL] 58,673 pass(es), 1 fail(s), and 0 exception(s). View

Yeah, I guess tests can't hurt. And it was especially easy with your help! Thanks again.

tstoeckler’s picture

+++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php
@@ -298,7 +298,7 @@ public function hasConfigSchema($name) {
-    return is_array($definition) && $definition['class'] != '\Drupal\Core\Config\Schema\Property';
+    return is_array($definition) && ($definition['class'] != '\Drupal\Core\Config\Schema\Property');

Oh yeah, that is not really necessary, but I hate to stare at something for 5 seconds until I grok it, and I think it's clearer this way.

Status: Needs review » Needs work

The last submitted patch, 2097259-has-config-schema-5.patch, failed testing.

tstoeckler’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
1.74 KB
2.35 KB
FAILED: [[SimpleTest]]: [MySQL] 58,717 pass(es), 1 fail(s), and 0 exception(s). View

That's embarassing. As soon as there's no autocompletion, I get 3 fatals for 3 LoC.

tstoeckler’s picture

FileSize
2.37 KB
PASSED: [[SimpleTest]]: [MySQL] 58,725 pass(es). View

Damn, I really need some sleep. The interdiff is correct, but this should have been the patch. #8 is identical to #5.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +language-config
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +API addition

Lets create a TypedConfigManagerInterface as we're adding a public method to an object.

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
1.96 KB
3.43 KB
PASSED: [[SimpleTest]]: [MySQL] 58,730 pass(es). View

Thanks for the review @alexpott. Here is the interface with Manager update.

vijaycs85’s picture

FileSize
496 bytes
3.45 KB
PASSED: [[SimpleTest]]: [MySQL] 58,583 pass(es). View

Minor doc comment update...

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Yay! Resolves the above concerns :)

Status: Reviewed & tested by the community » Needs work
Issue tags: -API addition, -D8MI, -language-config, -blocker

The last submitted patch, 2097259-has-config-schema-13.patch, failed testing.

vijaycs85’s picture

Status: Needs work » Needs review
Issue tags: +API addition, +D8MI, +language-config, +blocker

#13: 2097259-has-config-schema-13.patch queued for re-testing.

vijaycs85’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC as per @Gábor Hojtsy at #14

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.