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

Casted values to array. #19

Merged
merged 1 commit into from
Mar 5, 2015
Merged

Casted values to array. #19

merged 1 commit into from
Mar 5, 2015

Conversation

dutchiexl
Copy link

Casted all handler field values variables to arrays, because most of the time they are not an array but a string.

@ademarco
Copy link
Contributor

We should investigate it further since field handlers work on the assumption that values is always an array, and it should since it comes from https://github.com/jhedstrom/drupalextension/blob/master/src/Drupal/DrupalExtension/Context/RawDrupalContext.php#L249-249

Casting to an array is only curing the symptoms, the real problem seems to be somewhere else. What do you think?

@dutchiexl
Copy link
Author

Strange enough I have different code:

public function nodeCreate($node) {
    $this->dispatchHooks('BeforeNodeCreateScope', $node);
    $saved = $this->getDriver()->createNode($node);
    $this->dispatchHooks('AfterNodeCreateScope', $saved);
    $this->nodes[] = $saved;
    return $saved;
  }

using this in my composer file:
"drupal/drupal-extension": "~3.0",

@ademarco
Copy link
Contributor

Ah there we go! :) You should test using master branch from both projects.

On Fri, Feb 27, 2015 at 11:05 AM, dutchiexl [email protected]
wrote:

Strange enough I have different code:

public function nodeCreate($node) {
$this->dispatchHooks('BeforeNodeCreateScope', $node);
$saved = $this->getDriver()->createNode($node);
$this->dispatchHooks('AfterNodeCreateScope', $saved);
$this->nodes[] = $saved;
return $saved;
}

using this in my composer file:
"drupal/drupal-extension": "~3.0",


Reply to this email directly or view it on GitHub
#19 (comment).

@dutchiexl
Copy link
Author

Ok, this may be closed, master works ok

@ygerasimov
Copy link

How to set master branch properly?

When I have in my composer.json file

"drupal/drupal-extension": "dev-master",

I get error on "composer update"

Problem 1
- Installation request for drupal/drupal-extension dev-master -> satisfiable by drupal/drupal-extension[dev-master].
- drupal/drupal-extension dev-master requires drupal/drupal-driver dev-master -> no matching package found.

@ygerasimov
Copy link

I have updated drupal-driver to master branch manually (downloaded archive from github and replaced it locally), but it didn't help unfortunately.

@dutchiexl
Copy link
Author

hmmm, this is what I have, and it works for me:

 "drupal/drupal-extension": "dev-master",

If it doesn't work for you, something must be wrong with the packagist.

@jhedstrom jhedstrom reopened this Mar 5, 2015
jhedstrom added a commit that referenced this pull request Mar 5, 2015
@jhedstrom jhedstrom merged commit ae46652 into jhedstrom:master Mar 5, 2015
jhedstrom added a commit that referenced this pull request Mar 5, 2015
Casted values to array.

Signed-off-by: Jonathan Hedstrom <[email protected]>
@jhedstrom
Copy link
Owner

If you want to use dev-master I think you need to set minimum-stability to dev.

@dutchiexl
Copy link
Author

Yes indeed

@dutchiexl
Copy link
Author

I added this to my composer:

  "minimum-stability": "dev",
  "prefer-stable": true,

@ygerasimov
Copy link

Thanks guys, worked like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants