When adding the Operation "Create New Node Object" to a pipeline i get the following
error when i am in the form for the contenttype selection or author selection and try to click
on "Store Values" :
"Fatal error: Undefined class constant 'TfOperation::ClearOutputCache'
in C:\xampp\htdocs\drupaltest\sites\all\modules\transformations_drupal\transformations\operations.node.inc
on line 265".

Comments

presleyd’s picture

Project: Transformations » Transformations -- Drupal data

This is part of Transformations -- Drupal data instead of Transformations. I'm seeing the same thing. The code in question is attached below with a comment added to show line 265.

 /**
   * Overriding TfOperation::inputChanged().
   */
  protected function inputChanged($inputKey, $previousValue, $clearOutputCache = TfOperation::ClearOutputCache) { //line 265
    if ($inputKey == 'type') {
      if ($this->isInputSet($inputKey) && isset($previousValue)
          && $this->input($inputKey)->data() == $previousValue->data()) {
        return; // no changes
      }
      $this->updateOutputSchema('newNode');
    }
    parent::inputChanged($inputKey, $previousValue, TfOperation::ClearOutputCache);
  }
agill’s picture

Assigned: agill » Unassigned
agill’s picture

Status: Active » Closed (fixed)
ndm’s picture

Status: Closed (fixed) » Active

I have the same error :

Fatal error: Undefined class constant 'TfOperation::ClearOutputCache' in /home/kanea/domains/volcans.infos.st/public_html/sites/all/modules/importExport/transformations_drupal/transformations/operations.node.inc on line 102

If i send this command find . |xargs grep ClearOutputCache on the transformations directories, i don't find any declaration for this constant, is it normal?

After search this is not a constant but a function, and a reference on a function, method i supposed.

But why don't function at this time? A problem with php version, with php configuration? Is transformation core loaded when this error appear? A problem with the 'C' initial?

so i have made that with vi on transformations_drupal/transformations/operations.node.inc:
:%s/TfOperation::ClearOutputCache/'TfOperation::clearOutputCache'/g

I hope is a good solution, but i have no tested all the module.

If the maintainer can speak about this problem

tom_buytaert’s picture

i'm also having the same problem.

ndm's solution didn't help.

tom_buytaert’s picture

Priority: Normal » Critical

Since this error gives a total WSOD, it makes the entire module useless, so shouldn't it be marked 'Critical'?

regmanabq’s picture

I'll pipe up as having the same issue. Just when I thought this might be the best module ever!!!

Subscribing and hoping to see a fix, this module has such great potential but for now, back to the import drawing board for me ;(.

Perhaps of note: Once you get this error, you can not do anything else without getting the error. I thought maybe i'd try saving the pipeline or trying a different order when setting things, but no, after you get that error, even if you go back to the list and try to edit the saved version, I get this error instead.

rzelnik’s picture

subscribe

Matthew Davidson’s picture

In case it helps at all, I can report what seems to be a related error when setting the content type on a new node object:

Undefined class constant 'ClearOutputCache' in /var/www/drupal-6.14/sites/my.site.net.au/modules/transformations_drupal/transformations/operations.node.inc on line 273

I shall have a crack at solving this myself in the next week, but I'm a total newbie when it comes to OO in PHP, so I'm not overly optimistic about finding a solution in good time.

Syg’s picture

Indeed, there is no static element ClearOutputCache in TfOperation Class (file : transformations/core/transformations.operation.inc)
There is only one static function called "load()".

There is a method called clearOutputCache() but not static, maybe it's what you want to give to your function inputChanged($inputKey, $previousValue, $clearOutputCache = $this->clearOutputCache())
...
or maybe we can just provide this argument : $clearOutputCache without giving a default value and it will work but i do not know the drawback.

---

After doing this little hack, i found another bug line 47 in "transformations_drupal/transformations/operations.node.inc"

  public static function nodeFieldInfo($nodeField, $propertyKey) {
    switch ($propertyKey) {
      case 'label':
        return $nodeField['label'];

      default:
        $function = fieldtool_get_function(
          $nodeField, 'transformations slot property callback'
        );
        return $function($nodeField, $propertyKey); // line 47
    }
  }

The function returns something strange, i think it should return only $function.

---

I tried to go further in the tutorial 3 for XML importer but i've got another error:
When i create a node and then choose the content type, it works, but when i add fields i do not retrieve all the fields of the content type of the previously created node.

---

I finally tried to click on the execute button in the outer pipeline and had this error :

Exception: No input key "i:p:xmlNode" possible for operation For-each loop in /var/www/drupal/sites/all/modules/transformations/core/transformations.operation.inc on line 864

Hope this will help a little.

domson-1’s picture

The variable passed must not be a scalar variable, but a constant. I think the function clearoutputcache() is scalar.
I passed NULL as default or $this->clearoutputcache()

jim005’s picture

same issue. "Fatal error: Undefined class constant 'TfOperation::ClearOutputCache'
in [....] transformations\operations.node.inc on line 265".

it's critical, because this block the fonctionality "Create node object" ... so, we can't do much without that.

avantwaves’s picture

Same error here...
This is critical... I was building an entire project based in Transformations and Drupal Transformations... I guess that I will have to find another module/solution...

hachreak’s picture

Hi,
I have found that if you comment this, then the module don't return this error! :D

For example:

protected function inputChanged($inputKey, $previousValue/*, $clearOutputCache = TfOperation::ClearOutputCache*/) {
    if ($inputKey == 'type') {
      if ($this->isInputSet($inputKey) && isset($previousValue)
          && $this->input($inputKey)->data() == $previousValue->data()) {
        return; // no changes
      }
      $this->updateOutputSchema('newNode');
    }
    parent::inputChanged($inputKey, $previousValue/*, TfOperation::ClearOutputCache*/);
  }

So, I have comment all function that use ClearOutputCache.

bye bye .hachreak.