Skip to content

Conversation

@aronbeal
Copy link
Contributor

This is a continuation of the thread here. I had thought that I didn't need alteration functionality, but I've expanded the extension capabilities to the point where I needed to have this thing in the core driver, and I felt it might be a useful general addition.

I'm currently using my own fork of DrupalDriver within DrupalExtension that contains this code. I think it's a useful general addition, so I'm submitting the pull request. The alter functions expect fully loaded drupal objects for the first argument.

This is currently a D7 only implementation. I'm game to implement in D8 as well eventually, when we aren't so under the gun at my shop.

One area I need to highlight is the modification to userCreate to deal with the handling for user roles. I'm not sure that exploding the string there is the best solution to the problem - I welcome input.

aronbeal and others added 9 commits May 30, 2016 11:44
…rresponding to a content id), rather than just a title. This change makes the assumption that no entity content will have an integer title, which I believe seems safe enough.
…s groundwork in relevant interfaces (as far as I could tell) and DrupalDriver, throwing exceptions for anything but the version that I've implemented (D7 core)
…ctionality into the driver for deleting mutliples.
@aronbeal
Copy link
Contributor Author

aronbeal commented Jun 1, 2016

Note: in addition to the above, I've also added support for deleting multiple nodes and users at once to the interfaces, base classes (that throw 'non-implement' exceptions), and to D7. I don't (yet) have the ability to add and test the functionality for a D8 instance.

Aron and others added 20 commits June 1, 2016 11:40
…operty for entity (since it references it later on)
# Conflicts:
#	src/Drupal/Driver/DrushDriver.php
…ould no longer inadvertently overwrite fields I didn't want to. (this still needs to be added to the other driver files)
* 'master' of github.com:aronbeal/DrupalDriver:
  Added node and user multiple delete support to drush driver
- Brings Drupal7.php into phpcs compliance
# Conflicts:
#	src/Drupal/Driver/DrushDriver.php
We looked over this for awhile before we decided it was a bug.  In the case of allowed values in field info, the function had inverted the key/value pairings, and set the *key* as the return value, but in the case of callback functions, it sets the *value* of allowed_values as the return value.  This is despite the fact that the callback function is supposed to return a mapping of raw=>display values, which would mean that the display value was what was stored in the db (which was what was happening for us during api calls).

This corrects the handling so that, in each case, the options array is generated from a flip of the allowed values, and then handling of that options array is identical from that point forward.
@jhedstrom
Copy link
Owner

Are all the entity load methods needed for the alter functionality, or did they sneak in from another branch/PR?

@jhedstrom jhedstrom modified the milestones: 2.0, 2.1 Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants