Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Marcus Maihoff’s picture

Status: Active » Needs review
FileSize
1.43 KB
Marcus Maihoff’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
695 bytes
766 bytes

the last update is corrupt i fixed it with interdiff...
sry it was just my fault.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, thanks for providing the interdiff. I like!

Status: Needs review » Needs work
Issue tags: -Novice, -Drupal-Camping 2013

The last submitted patch, 2056445_unuse_variables-2.patch, failed testing.

Marcus Maihoff’s picture

Status: Needs work » Needs review
Issue tags: +Novice, +Drupal-Camping 2013

#2: 2056445_unuse_variables-2.patch queued for re-testing.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

That was just a bot hickup, still RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
diff --git a/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php b/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php
old mode 100644
new mode 100755

We shouldn't be changing the file mode

+++ b/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.phpundefined
@@ -30,7 +30,6 @@ static function getSubscribedEvents() {
     $importer = $event->getConfigImporter();
-    $importList = $importer->getStorageComparer()->getSourceStorage()->listAll();
     if (empty($importerList)) {

This looks slightly more complex since $importerList is not defined.

We need to is actually fix this code :)

tstoeckler’s picture

Issue tags: -Novice

Hmm, yeah that makes sense.

So $importList should not be removed, and instead in the if() it should be called $importList as well. This also means, however, that we're missing a test on this. Removing the Novice tag for that.

rahul.shinde’s picture

Assigned: Marcus Maihoff » rahul.shinde
Issue summary: View changes
rahul.shinde’s picture

Status: Needs work » Needs review
FileSize
775 bytes

The variable $importList is required and will resolve the purpose of getting all Configuration stuff for delete. So renamed $importerList to $importList.

xjm’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2080343: Remove Unused local variables from system module
xjm’s picture

Title: Remove Unused local variable $importList from /core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php » $importList misnamed in /core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php
Status: Closed (duplicate) » Needs work
Issue tags: +Needs tests

Actually, looks like this one has an actual bug associated with it? If so let's add tests. Sorry for closing pre-emptively; trying to update too many issues at once. :)

rahul.shinde’s picture

@xjm what will be the next step?

rahul.shinde’s picture

@xjim, Can we close this as i have added changes for this in https://drupal.org/node/2080343?

lokapujya’s picture

rahul.shinde, we should keep this separate, since this fixes a bug. The bug fix should get reviewed here before merging it in with the other unused variables.

lokapujya’s picture

So, I was trying to see what test needs to be written for this. However, I don't know if this event ever gets injected. SystemConfigSubscriber has a getSubscribedEvents() function. But, I don't think the function ever gets called. Anyone know why?

alexpott’s picture

Title: $importList misnamed in /core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php » Ensure that all config can not be deleted using the config importer
Priority: Normal » Major
Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
970 bytes
3.24 KB

There is already a test for this - but it was very broken and yep the event is never fired because it is not registered.

The last submitted patch, 17: 2056445.17-will-fail.patch, failed testing.

farfanfelipe’s picture

I tried to give you a hand on this one but I do not get why if the function was created to fail and it actually fails, what is the change that needs to be done here?

lokapujya’s picture

This patch looks good to me. onConfigImporterValidate() now gets called and the test validates that it throws an exception when the importList is empty.

swentel’s picture

+++ b/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php
@@ -19,18 +18,27 @@
+   * Checks that we not importing an from an empty source storage.

Wut ? :)

alexpott’s picture

FileSize
521 bytes
3.23 KB

@swentel thanks for the review!

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Great, RTBC if green.

The last submitted patch, 22: 17-22-interdiff.patch, failed testing.

catch’s picture

+++ b/core/modules/system/lib/Drupal/system/SystemConfigSubscriber.php
@@ -19,18 +18,27 @@
+      throw new ConfigImporterException("This import will delete all your active configuration, bailing out now.");

If it's bailing out now, then it's not actually going to delete all the active configuration. Could we say something like 'This import is empty and if applied would delete all of your configuration, so has been rejected.' or similar?

catch’s picture

Status: Reviewed & tested by the community » Needs work
alexpott’s picture

Status: Needs work » Needs review
FileSize
977 bytes
3.35 KB

Makes sense.

swentel’s picture

Status: Needs review » Reviewed & tested by the community
catch’s picture

Status: Reviewed & tested by the community » Fixed

OK I still feel like that message doesn't quite cover it, but can't think of anything better either and presumably this won't happen often, so committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

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