I hereby claim:
- I am davereid on github.
- I am davereid (https://keybase.io/davereid) on keybase.
- I have a public key ASDGf14g9qrXwf7c9jNd4PaKxk_OWYiUERdPjK9TYlvSDAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<?php | |
use Drupal\user\Entity\User; | |
use Drupal\Core\Entity\EntityInterface; | |
use Drupal\Core\Session\AccountInterface; | |
/** | |
* Implements hook_entity_access(). | |
*/ | |
function entity_delete_protect_entity_access(EntityInterface $entity, $operation, AccountInterface $account) { |
Typically you run a batch non-progressively like this:
batch_set($batch);
$batch = &batch_get();
$batch['progressive'] = FALSE;
batch_process();
But this does not work when running inside a SimpleTest. At least for SimpleTest via the UI, it runs in a batch itself. So messing with batch_set() and batch_get() here causes the SimpleTest batch runner to lose itself. Thankfully with one method we can easily run a batch from inside a SimpleTest:
<?php | |
/** | |
* @file | |
* Contains \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedFieldDisplay. | |
*/ | |
namespace Drupal\entity_embed\EntityEmbedDisplay; | |
use Drupal\Component\Plugin\Factory\DefaultFactory; |
davereid@Corsair250D ~/opt/PhpStorm-138.2001.2328/bin$ ./phpstorm.sh | |
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0 | |
Maximum number of clients reachedException in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment | |
at java.lang.Class.forName0(Native Method) | |
at java.lang.Class.forName(Class.java:264) | |
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103) | |
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82) | |
at javax.swing.RepaintManager.<clinit>(RepaintManager.java:233) | |
at javax.swing.JComponent.repaint(JComponent.java:4792) | |
at java.awt.Component.repaint(Component.java:3313) |
<?php | |
// This assumes used in Drupal and with https://www.drupal.org/project/helper installed. | |
$data = HttpHelper::getJson('https://api.github.com/users/drewboardman/events/public'); | |
// Transform the array into an array of event types keyed by event ID. | |
$events = ArrayHelper::extractNestedValuesToArray($data, array('type'), array('id')); | |
// Build the array of score values, including any even types that have not been accounted for. | |
$score_values = array( |
; Fix performance of path_delete() when there are no aliases to delete. | |
; @see https://www.drupal.org/node/1294964#comment-9158133 | |
projects[drupal][patch][] = "https://www.drupal.org/files/issues/1294964-path-delete-performance-do-not-test.patch" | |
; Fix ordering of path aliases to always return the latest one | |
; @see https://www.drupal.org/node/1160764#comment-9173531 | |
projects[drupal][patch][] = "https://www.drupal.org/files/issues/path_load_order-D7-do-not-test.patch" | |
; Fix "An AJAX HTTP request terminated abnormally" errors | |
; @see https://www.drupal.org/node/1232416#comment-8748879 |