We need to port Puzzler to D8 soon. Help — esp. patches — most welcome.

Comments

Vacilando created an issue. See original summary.

vacilando’s picture

Issue summary: View changes
Eugene Dubois’s picture

I really would like this a drupal 8 version of this module...
Maybe I could help, but not sure what needs doing. Are there any "upgrade module to drupal 8" manuals?

I have not really been involved in any drupal module development up to now, but maybe I could start doing an "upgrade".

KrypticBit’s picture

I'd Love to see this module for Drupal 8 :)

sealionking’s picture

I am looking for a d8 version. Thanks for update it.

nick hope’s picture

I attempted to upgrade version 7.x-1.x-dev (updated 19 May 2018 at 21:18 UTC) to Drupal 8 format using Drupal Module Upgrader 8.x-1.3 with Drush 8.1.17.

During the upgrade process I got this:

Indexing...done.
Error at line 3:1: unexpected < operator!          [error]
Error at line 3:1: unexpected < operator!          [error]

I'm not sure which file that error refers to.

I then got this error when I installed the converted module in D8.6.1, and no Puzzler configuration page was created:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Database\DatabaseExceptionWrapper</em>: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: CREATE TABLE {puzzler_cache} (
`name` VARCHAR(255) NOT NULL, 
`value` LONGBLOB NOT NULL, 
`expires` INT NULL DEFAULT NULL, 
`created_at` INT NOT NULL, 
UNIQUE KEY `ix_uniq_name` (`name`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4; Array
(
)
 in <em class="placeholder">drupal_install_schema()</em> (line <em class="placeholder">122</em> of <em class="placeholder">core\includes\schema.inc</em>). <pre class="backtrace">Drupal\Core\Database\Statement-&gt;execute(Array, Array) (Line: 625)
Drupal\Core\Database\Connection-&gt;query(&#039;CREATE TABLE {puzzler_cache} (
`name` VARCHAR(255) NOT NULL, 
`value` LONGBLOB NOT NULL, 
`expires` INT NULL DEFAULT NULL, 
`created_at` INT NOT NULL, 
UNIQUE KEY `ix_uniq_name` (`name`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4&#039;, Array, Array) (Line: 358)
Drupal\Core\Database\Driver\mysql\Connection-&gt;query(&#039;CREATE TABLE {puzzler_cache} (
`name` VARCHAR(255) NOT NULL, 
`value` LONGBLOB NOT NULL, 
`expires` INT NULL DEFAULT NULL, 
`created_at` INT NOT NULL, 
UNIQUE KEY `ix_uniq_name` (`name`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4&#039;) (Line: 622)
Drupal\Core\Database\Schema-&gt;createTable(&#039;puzzler_cache&#039;, Array) (Line: 122)
drupal_install_schema(&#039;puzzler&#039;) (Line: 217)
Drupal\Core\Extension\ModuleInstaller-&gt;install(Array, 1) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller-&gt;install(Array) (Line: 451)
Drupal\system\Form\ModulesListForm-&gt;submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder-&gt;processForm(&#039;system_modules&#039;, Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;system_modules&#039;, Object) (Line: 93)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 38)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 665)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

Does anyone know of another way to embed parts of Wikipedia pages in a D8 View/Block?

nick hope’s picture

It turns out the error in the first code block in my previous post was because I had Twig debugging enabled. When I disabled Twig debugging, that error went away, but I still got the error in the second code block.

Nevertheless I now seem to have part of a working D8 version. /admin/config/services/puzzler appears and accepts settings:

Puzzler config in D8

The list of tokens appears:

Puzzler tokens in D8

However I can't make any Wikipedia content actually appear when I use the Puzzler tokens. That might be user error, since I never used Puzzler before.

/admin/config/services/puzzler/dashboard gives this error:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Database\DatabaseExceptionWrapper</em>: SQLSTATE[42S02]: Base table or view not found: 1146 Table &#039;drupal.puzzler_cache&#039; doesn&#039;t exist: SELECT count(*) FROM {puzzler_cache}; Array
(
)
 in <em class="placeholder">Drupal\puzzler\Controller\DefaultController-&gt;puzzler_dashboard()</em> (line <em class="placeholder">22</em> of <em class="placeholder">modules\custom\puzzler\src\Controller\DefaultController.php</em>). <pre class="backtrace">Drupal\Core\Database\Statement-&gt;execute(Array, Array) (Line: 625)
Drupal\Core\Database\Connection-&gt;query(&#039;SELECT count(*) FROM {puzzler_cache}&#039;, Array, Array) (Line: 358)
Drupal\Core\Database\Driver\mysql\Connection-&gt;query(&#039;SELECT count(*) FROM {puzzler_cache}&#039;, Array, Array) (Line: 61)
db_query(&#039;SELECT count(*) FROM {puzzler_cache}&#039;) (Line: 22)
Drupal\puzzler\Controller\DefaultController-&gt;puzzler_dashboard()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 38)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 665)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

Nevertheless the dmu-upgrade-converted code in the attached zip file may help someone get this D8 port started. Note that inside the Puzzler folder there is a file called upgrade-info.html which was the output of the drush dmu-analyze puzzler command, and shows the changes necessary for the upgrade from D7 to D8.