drupal 8 https://www.millwoodonline.co.uk/taxonomy/term/5 en Drupal composer paranoia plugin https://www.millwoodonline.co.uk/blog/drupal-composer-paranoia-plugin <article role="article" about="/index.php/blog/drupal-composer-paranoia-plugin" typeof="schema:Article" class="article is-promoted full clearfix"> <span property="schema:name" content="Drupal composer paranoia plugin" class="hidden"></span> <span property="schema:interactionCount" content="UserComments:0" class="hidden"></span> <footer> <article typeof="schema:Person" about="/user/1"> </article> <div class="author"> Submitted by <span rel="schema:author"><span lang="" about="/index.php/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> on <span property="schema:dateCreated" content="2018-06-07T09:04:15+00:00">Thu, 07/06/2018 - 10:04</span> <span property="schema:dateCreated" content="2018-06-07T09:04:15+00:00" class="hidden"></span> </div> </footer> <div class="content"> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>Over the past few months one of my colleagues, Jean Ribeiro (<a href="https://www.drupal.org/u/jribeiro">jribeiro</a>), has been working in conjunction with Florian Weber (<a href="https://www.drupal.org/u/webflo">webflo</a>) from drupal-composer, on a composer plugin for added Drupal site security.</p> <p>The <a href="https://github.com/drupal-composer/drupal-paranoia">Drupal Paranoia</a> plugin works with two directories, <code>web</code> and <code>app</code>, although these can be renamed within you composer config to whatever works for you. The app directory is where all non-user facing code lives, this includes PHP, yaml, twig etc from core, contrib, and custom modules.The web directory then contains symlinks all user facing code, such as CSS, JS, and other files. It also contains stub PHP files for some items within the app directory.</p> <p>Within the plugin the public files directory is assumed to contain only user facing files, so it is symlinked. The codebase is then scanned for what are considered asset files. These are a fixed list of file extensions, which are expected to be used for module themeing and themes themselves, such as css, js, png, gif, etc. There is also a set list of "front controller" files, these are PHP files that do need to be user facing. The list includes <code>index.php</code>, <code>core/install.php</code>, <code>core/rebuild.php</code>, and <code>core/modules/statistics/statistics.php</code>. These files are then added via a stub PHP file, which calls the require function to pull them in.</p> <p>This plugin allows you to point your web server to the web directory without exposing any non-public files to users, giving an extra layer of security. There are no known specific security issues this will mitigate, however if there were any contrib or custom code with executable PHP code, this will update the codebase to make sure it's not remotely executable. For example in 2016 there was an<a href="https://www.drupal.org/forum/newsletters/security-advisories-for-contributed-projects/2016-07-13/coder-highly-critical"> issue found with coder module</a> were one of the executable PHP files opened a security hole. If anything like that were to happen again, you would be protected by using the <a href="https://github.com/drupal-composer/drupal-paranoia">Drupal Parnoia</a> plugin.</p> <p> </p> <p><em>Thanks to <a href="https://www.drupal.org/u/jribeiro">Jean Ribeiro</a> and <a href="https://www.drupal.org/u/badjava">Chad DeGoot</a> for helping write and review this blog post.</em></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/index.php/taxonomy/term/1" property="schema:about" hreflang="en">drupal planet</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/14" property="schema:about" hreflang="en">composer</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/34" property="schema:about" hreflang="en">plugin</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/3" property="schema:about" hreflang="en">drupal</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/4" property="schema:about" hreflang="en">drupal8</a></div> </div> </div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=49&amp;2=field_comment&amp;3=basic" token="eWWFfpdRX5FnI0fGfO_R6OLe0OCSRyfdUksf_JiQ4zc"></drupal-render-placeholder> </section> </div> </article> Thu, 07 Jun 2018 09:04:15 +0000 timmillwood 49 at https://www.millwoodonline.co.uk Workspace upgrade path https://www.millwoodonline.co.uk/blog/workspace-upgrade-path <article role="article" about="/blog/workspace-upgrade-path" typeof="schema:Article" class="article is-promoted full clearfix"> <span property="schema:name" content="Workspace upgrade path" class="hidden"></span> <span property="schema:interactionCount" content="UserComments:3" class="hidden"></span> <footer> <article typeof="schema:Person" about="/user/1"> </article> <div class="author"> Submitted by <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> on <span property="schema:dateCreated" content="2018-06-07T09:03:44+00:00">Thu, 07/06/2018 - 10:03</span> <span property="schema:dateCreated" content="2018-06-07T09:03:44+00:00" class="hidden"></span> </div> </footer> <div class="content"> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>We've taken some time recently to discuss how we're going to handle the upgrade from the Workspace contrib module to the Workspace core module, once it's released. In our setup we have around 20 sites, each with 4 (or more) environments, all with Workspace installed, syncing content between each environments (and sometimes between each site). Therefore this is a task we are taking very seriously and want to make sure we have a super stable approach which will result in no loss of production content.</p> <p>The obvious idea is that we provide some kind of update hook that converts all of the workspaces to the new core module, along with all of their content. However, the new Workspace module is quite different in the way that it stores and handled entities, therefore this will be a lot of work. We don't have a lot of time to do a lot of work because we have to port Multiversion and Relaxed modules over to handle all the features that are not going into core. We also have "day job" work to do helping to build and support these 20+ sites.</p> <p>The idea we are looking to implement is a lot more simple. Uninstall the contrib Workspace module, and install the core Workspace module.</p> <p>Uninstalling the Workspace module (and all dependencies) will delete all workspaces, and all content in them. Therefore what you will be left with, effectively, is the live workspace and all live content. Installing the new module will recreate a live (and stage) workspace, and all content will be associated with the live workspace. There will be some kind of check available to see if all content has been synced up to the live workspace to prevent real data loss, but we see workspaces as <span>disposable anyway.</span></p> <p><span>Another option we are looking into is being able to replicate content off to another Drupal site (or CouchDB database), then do the uninstall / reinstall process, and sync content back. This will work well because the HTTP API used will be the same on both versions of Relaxed module. However, because of the number of moving parts here we feel the straight uninstall / reinstall process, dropping all non-live content, might actually provide better stability.</span></p> <p><span>This process will be fully documented in release notes and on Drupal.org when the time comes.</span></p> <p><span>It'd be great to hear any feedback from users of the contrib Workspace module if this approach would work.</span></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/1" property="schema:about" hreflang="en">drupal planet</a></div> <div class="field--item"><a href="/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/taxonomy/term/3" property="schema:about" hreflang="en">drupal</a></div> <div class="field--item"><a href="/taxonomy/term/4" property="schema:about" hreflang="en">drupal8</a></div> <div class="field--item"><a href="/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/taxonomy/term/8" property="schema:about" hreflang="en">drupal core</a></div> <div class="field--item"><a href="/taxonomy/term/33" property="schema:about" hreflang="en">workspace</a></div> </div> </div> <ul class="links inline list-inline"><li class="comment-add"><a href="/blog/workspace-upgrade-path#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul><section> <h2>Comment</h2> <a id="comment-1829"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1528806653"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Vijay(vijaycs85) (not verified)</span> on Sun, 10/06/2018 - 21:50</p> <a href="/comment/1829#comment-1829" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1829#comment-1829" class="permalink" rel="bookmark" hreflang="en">I have been thinking about…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>I have been thinking about this part especially after I installed contib workspace on 8.6.x core and got weird exception (which remains me to raise <a href="https://www.drupal.org/project/workspace/issues/2978699">this issue</a>)</p> <p>How does the install/unstall would react to module with same name? Is it still possible to use <code>\Drupal::service('module_installer')</code>?</p> <p>Uninstalling contrib workspace module means uninstalling replication and multiversion (dependecies) and probably installl again with core module?</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1829&amp;1=default&amp;2=en&amp;3=" token="QLCNpotWPyvpCcG_0Yq8X-ZGsriy5KhiEg9Wvt36Rpo"></drupal-render-placeholder> </div> </article> <div class="indented"><a id="comment-1830"></a> <article data-comment-user-id="1" class="js-comment"> <mark class="hidden" data-comment-timestamp="1528806728"></mark> <footer> <article typeof="schema:Person" about="/user/1"> </article> <p>Submitted by <span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span> on Tue, 12/06/2018 - 13:32</p> <p class="visually-hidden">In reply to <a href="/comment/1829#comment-1829" class="permalink" rel="bookmark" hreflang="en">I have been thinking about…</a> by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Vijay(vijaycs85) (not verified)</span></p> <a href="/comment/1830#comment-1830" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1830#comment-1830" class="permalink" rel="bookmark" hreflang="en">You would need to uninstall …</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>You would need to uninstall (and remove Workspace contrib module) while still on 8.5.x, then upgrade to 8.6.x and enable the Workspace core module.</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1830&amp;1=default&amp;2=en&amp;3=" token="AgD7mSF2dFPyxNsaLi10WUpJtcpjL7XaQkhDzy7uBvk"></drupal-render-placeholder> </div> </article> <div class="indented"><a id="comment-1831"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1528987938"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Vijay (vijaycs85) (not verified)</span> on Tue, 12/06/2018 - 16:55</p> <p class="visually-hidden">In reply to <a href="/comment/1830#comment-1830" class="permalink" rel="bookmark" hreflang="en">You would need to uninstall …</a> by <span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></p> <a href="/comment/1831#comment-1831" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1831#comment-1831" class="permalink" rel="bookmark" hreflang="en">Got it, thanks!</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>Got it, thanks!</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1831&amp;1=default&amp;2=en&amp;3=" token="whjkeHXp4X1hIPzwpBhh_ED8exVI7cM6xkHKxbYUL8U"></drupal-render-placeholder> </div> </article> </div></div> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=48&amp;2=field_comment&amp;3=basic" token="JVQ1tkQLjuM4Ht-20VNde6I6huvTHt2eWlWRcskNZBE"></drupal-render-placeholder> </section> </div> </article> Thu, 07 Jun 2018 09:03:44 +0000 timmillwood 48 at https://www.millwoodonline.co.uk Drupal core Workspace module https://www.millwoodonline.co.uk/blog/drupal-core-workspace-module <article role="article" about="/blog/drupal-core-workspace-module" typeof="schema:Article" class="article is-promoted full clearfix"> <span property="schema:name" content="Drupal core Workspace module" class="hidden"></span> <span property="schema:interactionCount" content="UserComments:4" class="hidden"></span> <footer> <article typeof="schema:Person" about="/user/1"> </article> <div class="author"> Submitted by <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> on <span property="schema:dateCreated" content="2018-05-04T14:46:47+00:00">Fri, 04/05/2018 - 15:46</span> <span property="schema:dateCreated" content="2018-05-04T14:46:47+00:00" class="hidden"></span> </div> </footer> <div class="content"> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>The Workspace entity was first seen in the contrib module Multiversion on 1st June 2014. Back then the entity type was called "Content repository", it was renamed to "Workspace" in September 2014.</p> <p>On 22nd Febuary 2016 the Workspace module was created, which built upon the Multiversion module.</p> <p>The Workflow Initiative was announced in Dries' keynote DrupalCon New Orleans.</p> <p>Today the Workspace module landed in Drupal core as a new experimental module. This module is very different from the contrib Workspace module. It has no dependencies and now actually has a lot in common with the Drupal 7 module <a href="https://www.drupal.org/project/cps">CPS</a>.</p> <p>Please give the module a try, join us in the <a href="https://www.drupal.org/project/issues/drupal?component=workspace.module">issue queue</a>, and help us get Workspace module beta ready for 8.6.0-alpha1 in just over 2 months time.</p> <p><img src="https://www.millwoodonline.co.uk/sites/default/files/2018-05/workspace.gif" alt="Workspace demo" /></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/1" property="schema:about" hreflang="en">drupal planet</a></div> <div class="field--item"><a href="/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/taxonomy/term/3" property="schema:about" hreflang="en">drupal</a></div> <div class="field--item"><a href="/taxonomy/term/4" property="schema:about" hreflang="en">drupal8</a></div> <div class="field--item"><a href="/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/taxonomy/term/8" property="schema:about" hreflang="en">drupal core</a></div> </div> </div> <ul class="links inline list-inline"><li class="comment-add"><a href="/blog/drupal-core-workspace-module#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul><section> <h2>Comment</h2> <a id="comment-1820"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1526158644"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Wim Leers (not verified)</span> on Thu, 10/05/2018 - 11:21</p> <a href="/comment/1820#comment-1820" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1820#comment-1820" class="permalink" rel="bookmark" hreflang="en">Congrats! :)</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>Congrats! :)</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1820&amp;1=default&amp;2=en&amp;3=" token="3VXxL-eQN7tOYxAoMEtQPinq1w_mF26oR1VgOja_aoI"></drupal-render-placeholder> </div> </article> <a id="comment-1822"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1526158644"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Paolo (not verified)</span> on Thu, 10/05/2018 - 12:16</p> <a href="/comment/1822#comment-1822" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1822#comment-1822" class="permalink" rel="bookmark" hreflang="en">It&#039;s amazing how you…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>It's amazing how you succeeded not to say a word about what this module is about... but hey, we know it's whole history!</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1822&amp;1=default&amp;2=en&amp;3=" token="avANjwuG1ZOCha6rDf8dikFaUn2SyFdmByUDXDMBS8Q"></drupal-render-placeholder> </div> </article> <a id="comment-1823"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1526158644"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Wilma Smith (not verified)</span> on Fri, 11/05/2018 - 14:40</p> <a href="/comment/1823#comment-1823" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1823#comment-1823" class="permalink" rel="bookmark" hreflang="en">Hello, I am not a developer…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>Hello,<br /> I am not a developer, but I am interested in possibly useful Drupal modules and functionality. Workspace sounds like something useful, but I can't really discern from your introduction what it does. Could you please include some information on what Workspace does and for what purpose it woudl be useful?</p> <p>Thanks in advance for your information.<br /> regards, Wilma</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1823&amp;1=default&amp;2=en&amp;3=" token="jDB5MU7ut7msvv4JjaoiP7rQFLsCATf6nYK06zrvZyU"></drupal-render-placeholder> </div> </article> <a id="comment-1826"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1528987938"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Paul Rijke (not verified)</span> on Fri, 25/05/2018 - 22:17</p> <a href="/comment/1826#comment-1826" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1826#comment-1826" class="permalink" rel="bookmark" hreflang="en">It is a great succes ti get…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>It is a great success to get this in core. Thank you guys!</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1826&amp;1=default&amp;2=en&amp;3=" token="achegIzLv492t6qCukfy5m9r6x2d7mnBT1IHP-8w56A"></drupal-render-placeholder> </div> </article> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=46&amp;2=field_comment&amp;3=basic" token="biCwSqlVFOcJI6yHNg7zcy9HppBxfp_MbZMhW_tA1CI"></drupal-render-placeholder> </section> </div> </article> Fri, 04 May 2018 14:46:47 +0000 timmillwood 46 at https://www.millwoodonline.co.uk Getting started with React and Drupal https://www.millwoodonline.co.uk/blog/getting-started-with-react-and-drupal <article role="article" about="/blog/getting-started-with-react-and-drupal" typeof="schema:Article" class="article is-promoted full clearfix"> <span property="schema:name" content="Getting started with React and Drupal" class="hidden"></span> <span property="schema:interactionCount" content="UserComments:3" class="hidden"></span> <footer> <article typeof="schema:Person" about="/user/1"> </article> <div class="author"> Submitted by <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> on <span property="schema:dateCreated" content="2018-04-23T06:20:09+00:00">Mon, 23/04/2018 - 07:20</span> <span property="schema:dateCreated" content="2018-04-23T06:20:09+00:00" class="hidden"></span> </div> </footer> <div class="content"> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>Over the weekend I decided it was long overdue that I learnt React, or at least understood what all the fuss was about, so with npm in hand I installed yarn and started my quest.</p> <p>We're going to use <a href="https://github.com/facebook/create-react-app">Create React App</a> to setup our base React install. First install then run the command to create a react app called "drupal-react":<br /><code>npm install -g create-react-app<br /> create-react-app drupal-react<br /> cd drupal-react</code></p> <p>You can now run <code>npm start</code> (or <code>yarn start</code>) to start your app locally and open it in a browser. Here you'll see a React default page, this is all created from a React component called "App". If you take a look at the file src/App.js you will see the component and how the <code>render()</code> method returns the page HTML as <a href="https://reactjs.org/docs/introducing-jsx.html">JSX</a>. We need to replace to the code returned here to show some Drupal nodes, so how about replacing it with (or just adding) <code>&lt;NodeContainer /&gt;</code>. This will call a new component, so at the top of app.js we will also need to import that, so with the other import code add <code>import NodeContainer from './NodeContainer';</code>.</p> <p>Now to create the NodeContainer component. First we need to add the Axios library which we'll use to query the Drupal REST API, run <code>npm install axios --save</code>. Then create the file src/NodeContainer.js, and in there add the following code:<br /><code>import React, { Component } from 'react'<br /> import axios from 'axios'<br /><br /> class NodeContainer extends Component {<br />   constructor(props) {<br />     super(props)<br />     this.state = {<br />       nodes: []<br />     }<br />   }<br /><br />   componentDidMount() {<br />     axios.get('http://example.com/api/nodes')<br />     .then(response =&gt; {<br />       this.setState({nodes: response.data})<br />     })<br />     .catch(error =&gt; console.log(error))<br />   }<br /><br />   render() {<br />     return (<br />       &lt;ul&gt;<br />        {this.state.nodes.map((node) =&gt; {<br />           return(<br />            &lt;li={node.nid}&gt;{node.title}&lt;/li&gt;<br />           )<br />         })}<br />       &lt;/ul&gt;<br />     )<br />   }<br /><br /> }<br /><br /> export default NodeContainer</code></p> <p>At the top of the file React and Axios are both imported, the class for <code>NodeContainer</code> is then created. The constructor method is where we add the state <code>node</code>, <code>componentDidMount()</code> is called to get the nodes from the View /api/nodes, which then gets rendered as an unordered list.</p> <p>To create the /api/nodes view install the core Rest module. This will allow you to create a "REST Export" view. Here the path can be set to /api/nodes, and you can select nid, and title.</p> <p>As long as you left npm start running, you should be able to go back to your browser, and view a nice list of Drupal nodes being rendered in React.</p> <p>Next, routing, to make these node titles clickable! <span>😱</span></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/1" property="schema:about" hreflang="en">drupal planet</a></div> <div class="field--item"><a href="/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/taxonomy/term/3" property="schema:about" hreflang="en">drupal</a></div> <div class="field--item"><a href="/taxonomy/term/4" property="schema:about" hreflang="en">drupal8</a></div> <div class="field--item"><a href="/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/taxonomy/term/9" property="schema:about" hreflang="en">drupal development</a></div> <div class="field--item"><a href="/taxonomy/term/26" property="schema:about" hreflang="en">react</a></div> <div class="field--item"><a href="/taxonomy/term/27" property="schema:about" hreflang="en">reactjs</a></div> <div class="field--item"><a href="/taxonomy/term/28" property="schema:about" hreflang="en">javascript</a></div> </div> </div> <ul class="links inline list-inline"><li class="comment-add"><a href="/blog/getting-started-with-react-and-drupal#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul><section> <h2>Comment</h2> <a id="comment-1796"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1524559875"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">ygerasimov (not verified)</span> on Tue, 24/04/2018 - 02:05</p> <a href="/comment/1796#comment-1796" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1796#comment-1796" class="permalink" rel="bookmark" hreflang="en">Hey Tim, Thank you for…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>Hey Tim,</p> <p>Thank you for putting this together.</p> <p>Any recommendations about material to learn plain React? Preferably with PHP as backend. Like laracasts for vuejs.</p> <p>Yuriy</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1796&amp;1=default&amp;2=en&amp;3=" token="n0eg9BNprgPtH0wNsfaCJI1Ztl6BlVCXD2Y9whi9MNM"></drupal-render-placeholder> </div> </article> <div class="indented"><a id="comment-1797"></a> <article data-comment-user-id="1" class="js-comment"> <mark class="hidden" data-comment-timestamp="1524560027"></mark> <footer> <article typeof="schema:Person" about="/user/1"> </article> <p>Submitted by <span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span> on Tue, 24/04/2018 - 09:53</p> <p class="visually-hidden">In reply to <a href="/comment/1796#comment-1796" class="permalink" rel="bookmark" hreflang="en">Hey Tim, Thank you for…</a> by <span lang="" typeof="schema:Person" property="schema:name" datatype="">ygerasimov (not verified)</span></p> <a href="/comment/1797#comment-1797" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1797#comment-1797" class="permalink" rel="bookmark" hreflang="en">I started with React docs …</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>I started with React docs (<a href="https://reactjs.org/docs/hello-world.html">https://reactjs.org/docs/hello-world.html</a>), also looked Sitepoint (<a href="https://www.sitepoint.com/learn/react/">https://www.sitepoint.com/learn/react/</a>) and Lullabot (<a href="https://www.lullabot.com/articles/how-to-learn-react">https://www.lullabot.com/articles/how-to-learn-react</a>).</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1797&amp;1=default&amp;2=en&amp;3=" token="MEsgq6RKWiW72wASJ9-iH4dYoxsD5XRJ-5U_re3lfvU"></drupal-render-placeholder> </div> </article> </div><a id="comment-1798"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1524755103"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">dawehner (not verified)</span> on Tue, 24/04/2018 - 22:30</p> <a href="/comment/1798#comment-1798" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1798#comment-1798" class="permalink" rel="bookmark" hreflang="en">+1 for the official react…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>+1 for the official react docs. They got improved a lot over time.</p> <p>For more advanced tutorials I can recommend <a href="https://egghead.io/">https://egghead.io/</a> which is not fully free, but it is well done.</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1798&amp;1=default&amp;2=en&amp;3=" token="GA13uRswUHckkvN1kCaZQ8tYvUurkeBLPHxL9FSo2LE"></drupal-render-placeholder> </div> </article> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=44&amp;2=field_comment&amp;3=basic" token="6tdRzb_KucnJVgx1NkLq4i24_3-C-Lr841wCtq8uAhY"></drupal-render-placeholder> </section> </div> </article> Mon, 23 Apr 2018 06:20:09 +0000 timmillwood 44 at https://www.millwoodonline.co.uk Deprecation fails when testing Drupal 8 https://www.millwoodonline.co.uk/blog/deprecation-fails-when-testing-drupal-8 <article role="article" about="/blog/deprecation-fails-when-testing-drupal-8" typeof="schema:Article" class="article is-promoted full clearfix"> <span property="schema:name" content="Deprecation fails when testing Drupal 8" class="hidden"></span> <span property="schema:interactionCount" content="UserComments:2" class="hidden"></span> <footer> <article typeof="schema:Person" about="/user/1"> </article> <div class="author"> Submitted by <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> on <span property="schema:dateCreated" content="2018-02-26T08:57:15+00:00">Mon, 26/02/2018 - 08:57</span> <span property="schema:dateCreated" content="2018-02-26T08:57:15+00:00" class="hidden"></span> </div> </footer> <div class="content"> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>With each release of Drupal 8 more and more things are being deprecated, which is awesome. It shows innovation, forward thinking, and a thought for backwards compatibility. However throwing notices or warnings when deprecated code is used can cause tests to fail. We already counter this a little by adding <code>&lt;env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors"&gt;</code> to phpunit.xml.dist in core.</p> <p>To quote the <a href="https://symfony.com/doc/current/components/phpunit_bridge.html#making-tests-fail">Symfony documentation</a>:</p> <blockquote>By using the <code>weak_vendors</code> value, deprecations that are triggered outside the <code class="notranslate">vendors</code> directory will make the test suite fail, while deprecations triggered from a library inside it will not, giving you the best of both worlds.</blockquote> <p>This shows that deprecations within Drupal will still cause test fails, to combat that simply update the SYMFONY_DEPRECATIONS_HELPER setting to "weak" or "disabled", which would ignore the deprecations or disable the deprecation helper.</p> <p>However if you're testing with run-test.sh this will interfere with the settings in your phpunit.xml file and use always use weak_vendors unless you have the suppress-deprecations argument set. Therefore use <code>run-tests.sh --suppress-deprecations</code> and the SYMFONY_DEPRECATIONS_HELPER setting will be set to "disabled". See the <code>simpletest_script_run_one_test()</code> function in run-tests.sh for more context.</p> <p>Hopefully this helps, we found this really useful when testing Drupal modules with Travis, where we needed tests passing for Drupal 8.4 and 8.5.</p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/1" property="schema:about" hreflang="en">drupal planet</a></div> <div class="field--item"><a href="/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/taxonomy/term/3" property="schema:about" hreflang="en">drupal</a></div> <div class="field--item"><a href="/taxonomy/term/4" property="schema:about" hreflang="en">drupal8</a></div> <div class="field--item"><a href="/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/taxonomy/term/24" property="schema:about" hreflang="en">testing</a></div> <div class="field--item"><a href="/taxonomy/term/25" property="schema:about" hreflang="en">drupal testing</a></div> </div> </div> <ul class="links inline list-inline"><li class="comment-add"><a href="/blog/deprecation-fails-when-testing-drupal-8#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul><section> <h2>Comment</h2> <a id="comment-1527"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1519906034"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Pasqualle (not verified)</span> on Tue, 27/02/2018 - 21:36</p> <a href="/comment/1527#comment-1527" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1527#comment-1527" class="permalink" rel="bookmark" hreflang="en">Why don&#039;t we just remove the…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>Why don't we just remove the use of deprecated code? It should have been done before every minor Drupal core release..</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1527&amp;1=default&amp;2=en&amp;3=" token="iGoVRnL-xQ7uFVdc1CekCbOtthrEupWd8ZYGEYN4lag"></drupal-render-placeholder> </div> </article> <div class="indented"><a id="comment-1531"></a> <article data-comment-user-id="1" class="js-comment"> <mark class="hidden" data-comment-timestamp="1519906094"></mark> <footer> <article typeof="schema:Person" about="/user/1"> </article> <p>Submitted by <span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span> on Thu, 01/03/2018 - 12:08</p> <p class="visually-hidden">In reply to <a href="/comment/1527#comment-1527" class="permalink" rel="bookmark" hreflang="en">Why don&#039;t we just remove the…</a> by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Pasqualle (not verified)</span></p> <a href="/comment/1531#comment-1531" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/1531#comment-1531" class="permalink" rel="bookmark" hreflang="en">My use case for this was a…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>My use case for this was a contrib module where I needed to support both 8.4.x and 8.5.x versions of core. Therefore couldn't remove the use of deprecated code.</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1531&amp;1=default&amp;2=en&amp;3=" token="sYMvH-lyRy4sZadabWcwPoCv7TgNFavGMQYxh9dCEZo"></drupal-render-placeholder> </div> </article> </div> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=41&amp;2=field_comment&amp;3=basic" token="aiw6YOvX0o1rAYnyIUSX__C3tp7y4ma2mG0_IBE3icU"></drupal-render-placeholder> </section> </div> </article> Mon, 26 Feb 2018 08:57:15 +0000 timmillwood 41 at https://www.millwoodonline.co.uk Validating Drupal 8 Config https://www.millwoodonline.co.uk/blog/validating-drupal-8-config <span property="schema:name">Validating Drupal 8 Config</span> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>Did you know Drupal 8 has a new system to manage config? sure, everyone does by now.<br /> But, did you know you can validate the import of config? Maybe not, that's a bit more of a hidden gem.</p> <p>If you're writing a module that uses config entities or config for settings, you might want to make sure that the config is valid when imported. This came up recently in the core Content Moderation module. We wanted to make sure that when config for Workflows are imported they don't end up removing moderation states which are in use by other entities. For this we added an event subscriber, <code>ConfigImportSubscriber</code>, which is now part of Drupal 8.4.x.</p> <p>To add one of these to your modules first you will need to add a service to your modules services.yml file:</p> <p><code><br /> content_moderation.config_import_subscriber:<br /> class: Drupal\content_moderation\EventSubscriber\ConfigImportSubscriber<br /> arguments: ['@config.manager', '@entity_type.manager']<br /> tags:<br /> - { name: event_subscriber }<br /> </code> </p> <p>Here you will see, for content moderation, we have the service name, the class, a couple of arguments, and it's tagged as an event subscriber.</p> <p>You will then need to add you subscriber class within your module add the namespace added in services.yml.</p> <p><code>&lt;?php</p> <p>namespace Drupal\content_moderation\EventSubscriber;</p> <p>use Drupal\Core\Config\ConfigImporterEvent;<br /> use Drupal\Core\Config\ConfigImportValidateEventSubscriberBase;</p> <p>/**<br /> * Check moderation states are not being used before updating workflow config.<br /> */<br /> class ConfigImportSubscriber extends ConfigImportValidateEventSubscriberBase {</p> <p> /**<br /> * {@inheritdoc}<br /> */<br /> public function onConfigImporterValidate(ConfigImporterEvent $event) {<br /> if ($this-&gt;isWorkflowInUse($event) {<br /> $event-&gt;getConfigImporter()-&gt;logError($this-&gt;t('The workflow @workflow_label is being used, and cannot be deleted.', ['@workflow_label' =&gt; $workflow-&gt;label()]));<br /> }<br /> }</p> <p>}<br /> </code></p> <p>Here, with a lot of the logic removed for simplicity, we're extending <code>ConfigImportValidateEventSubscriberBase</code>, which is the base class for all validation of config at import. Then we override the <code>onConfigImporterValidate()</code> method, which passes in the <code>$event</code> object. From that object we need to determine if the config is valid or not, then log an error if not.</p> <p>This can also be tested in a kernel test:<br /> <code>$this-&gt;config('workflows.workflow.editorial')-&gt;get();</code> will get us the existing config for the editorial workflow entity.<br /> <code>\Drupal::service('config.storage.sync')-&gt;write('workflows.workflow.editorial', $config_data);</code> will allow us to update that config.<br /> <code>$this-&gt;configImporter()-&gt;reset()-&gt;import();</code> will then run an import, imported the updated config. This will need to be wrapped in a try/catch because a failing import will throw an exception. In the catch part of the statement we can pass or fail the test depending on the intended result.</p> <p>For more information take a look at the full event subscriber: <a href="http://cgit.drupalcode.org/drupal/tree/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php">http://cgit.drupalcode.org/drupal/tree/core/modules/content_moderation/…</a><br /> Also the full test: <a href="http://cgit.drupalcode.org/drupal/tree/core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php">http://cgit.drupalcode.org/drupal/tree/core/modules/content_moderation/…</a></p> </div> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> <span property="schema:dateCreated" content="2017-07-30T19:10:00+00:00">Sun, 30/07/2017 - 20:10</span> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/3" property="schema:about" hreflang="en">drupal</a></div> <div class="field--item"><a href="/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> </div> </div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=34&amp;2=field_comment&amp;3=basic" token="RYDggakGMbMlzaXqMVTCRLDlDAiGfmm6wrn9YVgcdbQ"></drupal-render-placeholder> </section> Sun, 30 Jul 2017 19:10:00 +0000 timmillwood 34 at https://www.millwoodonline.co.uk Programmatically install Drupal 8 module https://www.millwoodonline.co.uk/quicktips/programmatically-install-drupal-module <article role="article" about="/quicktips/programmatically-install-drupal-module" class="quick-tips is-promoted full clearfix"> <footer> <article typeof="schema:Person" about="/user/1"> </article> <div class="author"> Submitted by <span><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> on <span>Tue, 16/05/2017 - 07:41</span> </div> </footer> <div class="content"> <ul class="links inline list-inline"><li class="comment-add"><a href="/quicktips/programmatically-install-drupal-module#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>There are times, often in tests or upgrade paths, where we want to programmatically install a module. Here's how:</p> </div> <div class="field field--name-field-code field--type-text-long field--label-hidden field--item"><p><code>\Drupal::service('module_installer')-&gt;install(['workspace']);</code></p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/2" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/taxonomy/term/3" hreflang="en">drupal</a></div> <div class="field--item"><a href="/taxonomy/term/5" hreflang="en">drupal 8</a></div> </div> </div> <section> <h2>Comment</h2> <a id="comment-89"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1495488167"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Rupert (not verified)</span> on Fri, 19/05/2017 - 00:56</p> <a href="/comment/89#comment-89" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/89#comment-89" class="permalink" rel="bookmark" hreflang="en">Can you say a bit more about…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>Can you say a bit more about this? Where does this code go?</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=89&amp;1=default&amp;2=en&amp;3=" token="SwWSCyDRrp2IXwN_Ly_JZPoLEWRa4JERvaXDAtZzbGU"></drupal-render-placeholder> </div> </article> <div class="indented"><a id="comment-91"></a> <article data-comment-user-id="1" class="js-comment"> <mark class="hidden" data-comment-timestamp="1495708567"></mark> <footer> <article typeof="schema:Person" about="/user/1"> </article> <p>Submitted by <span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span> on Thu, 25/05/2017 - 11:36</p> <p class="visually-hidden">In reply to <a href="/comment/89#comment-89" class="permalink" rel="bookmark" hreflang="en">Can you say a bit more about…</a> by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Rupert (not verified)</span></p> <a href="/comment/91#comment-91" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/91#comment-91" class="permalink" rel="bookmark" hreflang="en">This code can go pretty much…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>This code can go pretty much anywhere. My most recent use for it was in a test where I wanted to add some content, then install a module, and test how the module reacted to the content which was there before the module was installed. For this I just added the code in the test method of a functional browser test.</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=91&amp;1=default&amp;2=en&amp;3=" token="6W6JJI7CbOFKfe2jD4MJ5Hf3dywwYzm9p1DzC2RvxRU"></drupal-render-placeholder> </div> </article> </div> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=32&amp;2=field_comment&amp;3=basic" token="LModBMUzx8TnKZnGs-CaCw93EYioUzEdlm3tWsrCE3M"></drupal-render-placeholder> </section> </div> </article> Tue, 16 May 2017 06:41:47 +0000 timmillwood 32 at https://www.millwoodonline.co.uk Enforce SSL in Drupal 8 using a redirect https://www.millwoodonline.co.uk/quicktips/enforce-ssl-drupal-8-using-redirect <span>Enforce SSL in Drupal 8 using a redirect</span> <span><span lang="" about="/index.php/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> <span>Wed, 03/05/2017 - 11:40</span> <ul class="links inline list-inline"><li class="comment-add"><a href="/index.php/quicktips/enforce-ssl-drupal-8-using-redirect#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul> <div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>Place this code within .htaccess underneath <code>RewriteEngine on</code>.</p> </div> <div class="field field--name-field-code field--type-text-long field--label-hidden field--item"><p><br /><code>RewriteCond %{HTTPS} off<br /> RewriteCond %{HTTP:X-Forwarded-Proto} !https<br /> RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </code></p> <p> </p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/index.php/taxonomy/term/2" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/3" hreflang="en">drupal</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/5" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/index.php/taxonomy/term/17" hreflang="en">ssl</a></div> </div> </div> <section> <h2>Comment</h2> <a id="comment-1825"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1528987938"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Rey (not verified)</span> on Wed, 23/05/2018 - 19:00</p> <a href="/index.php/comment/1825#comment-1825" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/index.php/comment/1825#comment-1825" class="permalink" rel="bookmark" hreflang="en">Exellent! Thank You...</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>Exellent! Thank You...</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=1825&amp;1=default&amp;2=en&amp;3=" token="dg3Wi8Se3OD76_VMi_06jem0lUERsBUpxWMwEZaeKiQ"></drupal-render-placeholder> </div> </article> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=30&amp;2=field_comment&amp;3=basic" token="p6w1G5PxvwwCCdtxM3gANNy6Z3tLcTyzjwNp81fDUIg"></drupal-render-placeholder> </section> Wed, 03 May 2017 10:40:52 +0000 timmillwood 30 at https://www.millwoodonline.co.uk Content Moderation + Content Translation = Crazy https://www.millwoodonline.co.uk/blog/content-moderation-content-translation-crazy <span property="schema:name">Content Moderation + Content Translation = Crazy</span> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>As part of the Drupal Workflow Initiative we have critical issue relating to Content Moderation and translations. This is not actually a Content Moderation issue, but is just surfaced by Content Moderation because it allows you to create forward revisions. The video here should explain the issue:</p> <div style="position:relative;height:0;padding-bottom:56.25%"><iframe src="https://www.youtube.com/embed/1WCfnOZd2Ks?ecver=2" width="640" height="360" frameborder="0" style="position:absolute;width:100%;height:100%;left:0" allowfullscreen=""></iframe></div> <p><a href="https://www.drupal.org/node/2766957">Forward revisions + translation UI can result in forked draft revisions</a> and <a href="https://www.drupal.org/node/2860097">Only having one default revision per entity forces translations to be kept in sync</a> are the related core issues.</p> </div> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> <span property="schema:dateCreated" content="2017-04-28T15:08:52+00:00">Fri, 28/04/2017 - 16:08</span> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> <div class="field--item"><a href="/taxonomy/term/8" property="schema:about" hreflang="en">drupal core</a></div> <div class="field--item"><a href="/taxonomy/term/3" property="schema:about" hreflang="en">drupal</a></div> </div> </div> <ul class="links inline list-inline"><li class="comment-add"><a href="/blog/content-moderation-content-translation-crazy#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a></li></ul><section> <h2>Comment</h2> <a id="comment-16"></a> <article data-comment-user-id="0" class="js-comment"> <mark class="hidden" data-comment-timestamp="1493482187"></mark> <footer> <article typeof="schema:Person" about="/user/0"> </article> <p>Submitted by <span lang="" typeof="schema:Person" property="schema:name" datatype="">Agnar Ødegård (not verified)</span> on Fri, 28/04/2017 - 19:36</p> <a href="/comment/16#comment-16" hreflang="en">Permalink</a> </footer> <div> <h3><a href="/comment/16#comment-16" class="permalink" rel="bookmark" hreflang="en">You have one field (revision…</a></h3> <div class="field field--name-comment-body field--type-text-long field--label-hidden field--item"><p>You have one field (revision) in the node table and you're trying to keep tabs on two or more pieces of information. You may succeed by creating rules to keep revision number across languages to be the same, but as you point out, when reverting revision for one language you really don't know the correct revision for the other language(s).</p> <p>I think we'd avoid a lot of hurt by introducing a new table translation_revision. The id in this table will replace the revision id in the node table. The new table will know which revision is current for any language. </p> <p>This will for sure break BC, but in the end I think it will be the cleanest solution.</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=16&amp;1=default&amp;2=en&amp;3=" token="aa82bESdGQKCWi8uMRdL3XKUwTNWpzYQezXugPbYeDs"></drupal-render-placeholder> </div> </article> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=27&amp;2=field_comment&amp;3=basic" token="YHVINN1QEUqZE-VVsLSNO-9tmwyfkIInBu-hYXNBW-g"></drupal-render-placeholder> </section> Fri, 28 Apr 2017 15:08:52 +0000 timmillwood 27 at https://www.millwoodonline.co.uk Workspaces, Deploy, and Relaxed web services https://www.millwoodonline.co.uk/blog/workspaces-deploy-relaxed-web-services <article role="article" about="/blog/workspaces-deploy-relaxed-web-services" typeof="schema:Article" class="article is-promoted full clearfix"> <span property="schema:name" content="Workspaces, Deploy, and Relaxed web services" class="hidden"></span> <span property="schema:interactionCount" content="UserComments:0" class="hidden"></span> <footer> <article typeof="schema:Person" about="/user/1"> </article> <div class="author"> Submitted by <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">timmillwood</span></span> on <span property="schema:dateCreated" content="2017-04-23T21:00:00+00:00">Sun, 23/04/2017 - 22:00</span> <span property="schema:dateCreated" content="2017-04-23T21:00:00+00:00" class="hidden"></span> </div> </footer> <div class="content"> <div property="schema:text" class="field field--name-body field--type-text-with-summary field--label-hidden field--item"><p>A few weeks ago I recorded an updated screencast of the Workspace, Deploy, and Relaxed Web services module. Here it is:</p> <div style="position:relative;height:0;padding-bottom:56.25%"><iframe src="https://www.youtube.com/embed/ibBX2cHdhu8" width="640" height="360" frameborder="0" style="position:absolute;width:100%;height:100%;left:0" allowfullscreen=""></iframe></div> <p>Please comment, tweet, IRC, or Slack any questions.</p></div> <div class="field field--name-field-tags field--type-entity-reference field--label-above"> <div class="field--label">Tags</div> <div class="field--items"> <div class="field--item"><a href="/taxonomy/term/2" property="schema:about" hreflang="en">drupal-planet</a></div> <div class="field--item"><a href="/taxonomy/term/5" property="schema:about" hreflang="en">drupal 8</a></div> </div> </div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=26&amp;2=field_comment&amp;3=basic" token="2shlcoqjyPHLDaHyGlVg59UJy8TkeruJursh9AzoA4o"></drupal-render-placeholder> </section> </div> </article> Sun, 23 Apr 2017 21:00:00 +0000 timmillwood 26 at https://www.millwoodonline.co.uk