Skip to content

Instantly share code, notes, and snippets.

View plepe's full-sized avatar

Stephan Bösch-Plepelits plepe

View GitHub Profile
@plepe
plepe / testfind.js
Created March 2, 2017 21:02
pouchdb-find error with elemMatch and array of objects
#!/usr/bin/env node
var async = require('async')
var PouchDB = require('pouchdb')
PouchDB.plugin(require('pouchdb-find'))
var db = PouchDB('foobar')
async.series([
// drop database and re-create (always start with new database)
@plepe
plepe / report.md
Created October 12, 2018 10:56
How I migrated Drupal 6 (with Biblio module) to Drupal 8 (with Bibcite module)

How I migrated Drupal 6 (with Biblio module) to Drupal 8 (with Bibcite module)

I got the task of upgrading an old Drupal 6 webpage to a newer version. We decided to skip Drupal 7 and go directly for Drupal 8 with the new bibcite module (although it is still at 1.0-alpha7 at the time of this writing).

Upgrading most of the content of Drupal 6 to Drupal 8 worked rather fine, with the exception of the Views which have to be migrated separately. Migrating the content of the biblio to bibcite was quite a task though. In this text, I will report how I did the transition.

One of the biggest hurdles was, that the migration would split the publications into two separate entitys. In Drupal 6, there was a "Biblio" content type, which had a "biblio" field with all the bibliographic sub-fields. And there were a fewer custom fields (via CCK), e.g. a teaser image and some node references to projects (which were a separate content type).

After the migration, the publications are a separate entity type (Content -> Biblio

@plepe
plepe / copy.php
Last active March 15, 2019 11:01
Drupal 8: A script to copy settings from manage display for "search result" of bibcite to all other bibcite types.
<?php
$db = new PDO('mysql:dbname=drupal8', '', '');
$res = $db->query("select * from config where name='core.entity_view_display.bibcite_reference.conference_paper.search_result'");
$elem = $res->fetch();
$orig_data = unserialize($elem['data']);
$res = $db->query("select * from config where name like 'bibcite_entity.bibcite_reference_type.%'");
$types = array();
while ($elem = $res->fetch()) {
$type = substr($elem['name'], 38);
@plepe
plepe / HOWTO.md
Last active June 15, 2023 11:01
Installing Mailman3 on Ubuntu 18.04 with MariaDB

Installing Mailman3 on Ubuntu 18.04 with MariaDB

Installing Mailman3 on Ubuntu 18.04 was surprisingly difficult, that's why I want to share my experiences with the world. Here you are:

First install MariaDB

apt install mariadb-server

Add to [mysqld] in /etc/mysql/mariadb.conf.d/50-server.cnf:

@plepe
plepe / display_suite_twig.md
Created September 25, 2023 11:36
Drupal Display Suite - Twig Field Documentation

I couldn't find any documentation about Twig Fields using Display Suite, so I decided to create one on my own. You are very welcome to add more information.

Adding a Twig field in Drupal Display Suite, you can use the following syntaxes:

Render the ID of the current entity:

{{ entity.id }}

Render the value of a text field (called 'Foo'):