Now we have an id() method on the ExportableBase class, we can convert calls to ->info['key'] on the controller.

Comments

damiankloip’s picture

Issue tags: +VDC

Tag.

dawehner’s picture

+++ b/lib/Drupal/ctools/DatabaseExportableController.phpundefined
@@ -211,23 +211,23 @@ class DatabaseExportableController extends ExportableControllerBase {
-        if (!empty($this->cache[$object->{$this->info['key']}])) {
-//          $this->cache[$object->{$this->info['key']}]->{$this->info['export type string']} = t('Overridden');
-          $this->cache[$object->{$this->info['key']}]->setIsInCode(TRUE);
-          $this->cache[$object->{$this->info['key']}]->setExportModule($object->getExportModule());
+        if (!empty($this->cache[$object->id()])) {
+//          $this->cache[$object->id()]->{$this->info['export type string']} = t('Overridden');
+          $this->cache[$object->id()]->setIsInCode(TRUE);

It is marked as being in code, but not really in the database is that intended? Previously it seemed to be overridden
shouldn't it be now?

dawehner’s picture

The rest looks fine and is a real great improvement in terms of readability of the code.

damiankloip’s picture

dawehner, thanks!

In #2 the exportables will be loaded from the database and ->isInDatabase() will be set then, if a default exists ->isInCode() will be set in the code you pasted above. Is that what you mean?

I am not sure if the export type is staying at the moment. They are all commented out currently. I guess that's a question for merlinofchaos!

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

The converting to id() itself looks perfect, lets do the mentioned problem in another issue.

damiankloip’s picture

Status: Reviewed & tested by the community » Fixed

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