Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marvil07’s picture

Status: Active » Needs review
FileSize
12.44 KB

Here a first functional version!

Please let me know what more needed here.

marvil07’s picture

Assigned: marvil07 » Unassigned
Mile23’s picture

Thanks, marvil07.

+++ b/cron_example/cron_example.moduleundefined
@@ -0,0 +1,250 @@
+/**
+ * Implements hook_cron().
+ *
+ * hook_cron() is the traditional (pre-Drupal 7) hook for doing "background"
+ * processing. It gets called every time the Drupal cron runs and must decide
+ * what it will do.

Many references to Drupal 7.

Adopting the structure of a D8 module is great (with lib directory, etc.), but the documentation needs some editorial attention as well.

Mile23’s picture

Status: Needs review » Postponed

You're welcome to submit more patches, but we're holding off on D8 a bit: #1861598: Examples for Drupal 8 needs relatively stable feature set

Mile23’s picture

Status: Postponed » Needs work
marvil07’s picture

FileSize
11.8 KB

minor re-roll with info file to yml, still needs real changes

wesleydv’s picture

Status: Needs work » Needs review
FileSize
13.6 KB

Rewrote the patch to use a form controller and new Drupal 8 function like config mgmt

tsphethean’s picture

Status: Needs review » Needs work
+++ b/cron_example/cron_example.moduleundefined
@@ -0,0 +1,120 @@
+ * hook_cron_queue_info() and family are new since Drupal 7, and allow any

hook_cron_queue_info should be hook_queue_info and the comment needs updating as this is a new hook in D8.

+++ b/cron_example/lib/Drupal/cron_example/Forms/CronExampleForm.phpundefined
@@ -0,0 +1,176 @@
+ * Contains \Drupal\cron_example\Form\CronExampleForm.

No full stop on contains

+++ b/cron_example/lib/Drupal/cron_example/Forms/CronExampleForm.phpundefined
@@ -0,0 +1,176 @@
+ * Defines a form to configure maintenance settings for this site.

This comment is a little odd

+++ b/cron_example/lib/Drupal/cron_example/Forms/CronExampleForm.phpundefined
@@ -0,0 +1,176 @@
+      '%time' => date_iso8601(variable_get('cron_example_next_execution', time())),
+      '%seconds' => variable_get('cron_example_next_execution', time()) - time(),

Shouldn't these be got from $config->get()

+++ b/cron_example/lib/Drupal/cron_example/Forms/CronExampleForm.phpundefined
@@ -0,0 +1,176 @@
\ No newline at end of file

no newline at end of file?

wesleydv’s picture

Status: Needs work » Needs review
FileSize
13.61 KB

Fixed issues raised by tsphethean

marvil07’s picture

@wesleydv: Thanks for the new patch implementing new APIs!

I will try to make a closer look as soon as I fix the tests for other submodules already added to 8.x-1.x, so your patch can be tested by testbot. I only could fix block_example today.

marvil07’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Mile23’s picture

Issue summary: View changes

Note: This module is now very broken because it relies on variable_set().

#2197267: Remove variable_set()/variable_get() from cron_example