Skip to content

Instantly share code, notes, and snippets.

☁️
Contrib Notorious

Daniel Phin dpi

☁️
Contrib Notorious
Block or report user

Report or block dpi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dpi
dpi / Drupal revision_translation_affected.md
Created Mar 15, 2019
revision_translation_affected for test entities
View Drupal revision_translation_affected.md

Getting issues like?

Drupal\Core\Entity\Query\QueryException: 'revision_translation_affected' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 351 of core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).
Drupal\Core\Entity\Query\Sql\Tables->addField('revision_translation_affected', 'INNER', 'en') (Line: 52)
Drupal\Core\Entity\Query\Sql\Condition->compile(Object) (Line: 172)
Drupal\Core\Entity\Query\Sql\Query->compile() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 433)
Drupal\Core\Entity\ContentEntityStorageBase->getLatestTranslationAffectedRevisionId('1', 'en') (Line: 157)
Drupal\content_moderation\ModerationInformation->hasPendingRevision(Object) (Line: 58)
@dpi
dpi / jobitem.php
Last active Apr 15, 2016
notifyNeedsReview redux
View jobitem.php
/**
* Notify the owner of the Job using courier.
*/
private function notifyNeedsReview() {
$template_collection_ids = \Drupal::state()->get('tmgmt_notifications_template_collections', []);
if (isset($template_collection_ids['job_item_needs_review'])) {
$id = $template_collection_ids['job_item_needs_review'];
/** @var \Drupal\courier\TemplateCollectionInterface $template_collection */
@dpi
dpi / registrants.php
Last active Aug 29, 2015
Registrants for an event via API (https://github.com/dpi/rng)
View registrants.php
$event = entity_load( your event entity here )
$event_manager = \Drupal::service('rng.event_manager');
$event_meta = $event_manager->getMeta($event);
foreach ($event_meta->getRegistrations() as $registration) {
foreach ($registration->getRegistrants() as $registrant) {
$registrant->label();
$registrant->id();
}
}
@dpi
dpi / gist:1079482
Created Jul 13, 2011
Drupal Relation/References Widgets
View gist:1079482
<letharion> chx: Do you already have any thoughts on whether and how to provide a references-style field widget for nodes?
<chx> letharion: no
<chx> letharion: we will reuse the references widgets instead.
<letharion> chx: Great. Have you talked to the maintainers? Do we intend to copy their widgets into the relation codebase?
<chx> copy?
<chx> heaven forbid
<chx> this is field API
<chx> we just need to make a field type
<chx> and then alter widget info to get em in the house.
<letharion> chx: I'm not sure I follow, will references then depend on relation?
You can’t perform that action at this time.