Skip to content

Instantly share code, notes, and snippets.

@dawehner
dawehner / -
Created December 7, 2016 01:02
diff --git a/ZuoraSSL.py b/ZuoraSSL.py
index 8425b58..19d3701 100644
--- a/ZuoraSSL.py
+++ b/ZuoraSSL.py
@@ -108,7 +108,7 @@ class ZuoraSSL(object):
:return:
"""
pub_key = RSA.load_pub_key(self.public_key_loc)
- encrypted = pub_key.public_encrypt(message, RSA.pkcs1_padding)
+ encrypted = pub_key.public_encrypt(bytes(message, 'utf-8'), RSA.pkcs1_padding)
Auf der Website ist ein unvorhergesehener Fehler aufgetreten. Bitte versuchen Sie es später nochmal.
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'langcode' in field list is ambiguous: SELECT node_field_data.langcode AS node_field_data_langcode, node_field_data.created AS node_field_data_created, node_field_data.nid AS nid, node_field_revision_workbench_revision_tracker.vid AS node_field_revision_workbench_revision_tracker_vid, langcode AS langcode FROM {node_field_data} node_field_data LEFT JOIN {workbench_revision_tracker} workbench_revision_tracker ON node_field_data.nid = workbench_revision_tracker.entity_id AND (workbench_revision_tracker.entity_type = :views_join_condition_0 AND workbench_revision_tracker.langcode = node_field_data.langcode) LEFT JOIN {node_field_revision} node_field_revision_workbench_revision_tracker ON workbench_revision_tracker.revision_id = node_field_revision_workbench_revision_tracker.vid AND (workbench_
before:
$node->nodeValue = Html::transformRootRelativeUrlsToAbsolute($html_markup, $request->getSchemeAndHttpHost());
after:
$node->nodeValue = '';
$node->appendChild($rss_dom->createCDATASection(Html::transformRootRelativeUrlsToAbsolute($html_markup, $request->getSchemeAndHttpHost())));
@dawehner
dawehner / -
Created November 23, 2016 08:46
core/lib/Drupal/Core/Entity/EntityListBuilder.php:142: if ($entity->access('update') && $entity->hasLinkTemplate('edit-form')) {
core/modules/comment/src/CommentLazyBuilders.php:176: if ($entity->access('update')) {
core/modules/comment/src/Plugin/Action/SaveComment.php:31: return $object->access('update', $account, $return_as_object);
core/modules/comment/src/Plugin/Action/PublishComment.php:33: ->andIf($object->access('update', $account, TRUE));
core/modules/comment/src/Plugin/Action/UnpublishByKeywordComment.php:122: $result = $object->access('update', $account, TRUE)
core/modules/comment/src/Plugin/Action/UnpublishComment.php:33: ->andIf($object->access('update', $account, TRUE));
core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php:229: $may_update = $set['comment']->access('update', $set['user']) && $set['comment']->subject->access('edit', $set['user']);
core/modules/content_translation/src/Controller/ContentTranslationController.php:183: $update_access
@wimleers So what I was thinking was creating a render context, execute ```$item->processed``` in there, and then call ```$this->bubble($render_context->bubble());```
@wimleers So what I was thinking was creating a render context, execute $item->processed in there, and then call $this->bubble($render_context->bubble());
public static function removeHtmlTags($string, array $tags = []) {
$dom = Html::load($string);
foreach ($tags as $tag) {
foreach ($dom->getElementsByTagName($tag) as $places) {
$places->parentNode->removeChild($places);
}
}
return $dom->saveHTML();
$mode = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED);
if ($mode === COMMENT_MODE_FLAT) {
$field = 'c.cid';
$order_by = $query->getOrderBy();
if (isset($order_by[$field])) {
$query->orderBy($field, 'DESC');
}
}
else {
// The goal of this alter is to sort comments in the following way:
example_name:
path: /foo/bar/baz
controller: ...
title: ...
access:
permission: ...
=>
example_name:
@dawehner
dawehner / -
Created November 2, 2016 19:11
# General settings
unbind C-b
unbind l
set -g prefix C-f
bind-key C-a last-window
set -g status-keys vi
# Faster Command Sequences
set -s escape-time 0