-
-
Notifications
You must be signed in to change notification settings - Fork 101
Adding node and user alter functionality #85
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
Open
aronbeal
wants to merge
30
commits into
jhedstrom:master
Choose a base branch
from
aronbeal:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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)
…y loaded node object.
…ctionality into the driver for deleting mutliples.
… cleanup under new paradigm.
…n phpcs-ruleset.xml)
…and to trigger a Travis build)
Contributor
Author
|
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. |
…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
… I'm not sure why.
…ction. Matches similar on nodeAlter
- 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.
Owner
|
Are all the entity load methods needed for the alter functionality, or did they sneak in from another branch/PR? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.