Create a Drupal 8 version of the Legal module.

Comments

robert castelo’s picture

Version: master » 8.x-1.x-dev
mikael berger’s picture

I get the following error when trying to install: legal-8.x-1.x-dev.tar.gz does not contain any .info.yml files. (The same goes for zip file).

Mircea Shanti’s picture

The same. Any solutions?

Daniel Schaefer’s picture

I'm getting the following warning when installing via Drush:
array_flip(): Can only flip STRING and INTEGER values! EntityStorageBase.php:232.

The module enables but there is no configuration at all.

--
Edit. I am now getting this with every drush command so it may not be related to Legal. will keep you posted.
--
I tried uninstalling via the UI and it would return a "website encountered problem" WSOD. Uninstalling via drush returns

Error: Call to undefined function variable_del() in
modules/legal/legal.install, line 58
haza’s picture

I had a very quick look on the current 8.x branch. The code is really not ready now. My guess is that the d8 release should not even be displayed on the projet page since it obvisously can't work as it's current state.

robert castelo’s picture

Drupal 8 version of Legal module is currently only a branch for developers to work on, there is no official release yet.

haza’s picture

Agreed, but you could hide the "8.x-1.x-dev" release on the project page. It could prevent user to (easily) download the .tar.gz package and try to install it. Developper can still clone the git repository.

robert castelo’s picture

Good point, I've unticked 'Supported' so that it doesn't display on the project page.

Course now I'm going to get lots of issues with people asking if I'm working on a Drupal 8 version yet ;-)

Daniel Schaefer’s picture

I'm glad you've decided to pull back the version. Making sure we don't leave those standing in the rain who have already installed this module, we should address the experienced issues asap.

ikit-claw’s picture

Anything I can do to help this project? How can I get my hands on the dev version?

marvin_b8’s picture

i work on a drupal 8 port at the momment

https://github.com/mbutkereit/legal

i will post tomorrow a patch for the current legal 8.x version.

marvin_b8’s picture

StatusFileSize
new134.48 KB

A first alpha state patch for the d8 version.
I think everything work's like in d7 but there a lot of legacy code.

It's a patch for the current legal 8.x-1.x version.

Any feedback would be great.

(The same code is on github.)

Anonymous’s picture

Status: Active » Needs work

I gave it a try and after making a small change I got it working.

The account you want to verify could also be null in legal_form_user_form_alter.
I just changed this

  $account = $form_state->get('user');
  if($account){
     $uid = $account->get('uid')->getString();
  }

and then it worked. Anyway a good starting point. Thx

Anonymous’s picture

Based on your patch #12 I added some extensions and fixes like:

  • Vertical tabs in admin settings
  • Option to enable and disable detail container
  • Diffrent display styles for registration and login form

I found some other problems but I didn'T fix them yet. For example page link is not rendered correctly.

rfay’s picture

Just a note that @marvin_B8's github repo has come along quite a way since the last post, and the version there is pretty usable, if imperfect. It would be great to bring it into the 8.x-1.x branch, just do it via git or whatever. https://github.com/mbutkereit/legal

caxy4’s picture

I second @rfay's suggestion.
I'm using the latest from https://github.com/mbutkereit/legal on a production site and haven't encountered any issues.

I'd say the code is at least ready for an alpha.

Christopher Riley’s picture

Can we get an update as to the status of the module. Drupal 8 has been out for over a year and I have a site that I am trying to get up and running on D8 and really want to use this module.

Thanks in advance

hypertext200’s picture

The Github version of the module is working fine, so please push it to the d.o git and create a release. Thanks @marvin_B8 for the great effort.

Thanks

smaz’s picture

Based on the above comments of the D8 version being used by several people for quite a while now, is it possible to bring the github repo as a release on d.org, even if alpha/beta for now?

smaz’s picture

Status: Needs work » Needs review
robert castelo’s picture

Yes, but we'll need to wait until the security release for D7 version and then apply it to the beta.

edurenye’s picture

The security release was already done few month ago, the github repo works fine enough, just import it so we can use it easily with drupal composer and we can continue improving it.

edurenye’s picture

StatusFileSize
new159.42 KB

This is just the difference between drupal.org 8.x-1.x and github mbutkereit/legal 8.x-1.x. It's between if you pull commits from github to give credit to the correct people, I'm just uploading the patch to be able to use with composer patches.

lomasr’s picture

StatusFileSize
new1.54 KB

Drupal 8 git repo code does not look as per Drupal 8 coding standard for ex hook_help in Drupal 8 is now

use Drupal\user\RoleInterface;
use Drupal\Core\Routing\RouteMatchInterface;
/**
 * Implements hook_help().
 */

function legal_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    // Main module help for the user_expire module.
    case 'help.page.legal':
      $output = '<h3>' . t('About') . '</h3>';
      $output .= '<dt>'.t('This module which displays your Terms & Conditions to users who want to
    register, and makes sure they accept the T&C before their registration
    is accepted.'). '</dt>';
      return $output;
    break;
  }
}

Adding a patch for example.

lomasr’s picture

Status: Needs review » Needs work

  • Robert Castelo committed 5b72497 on 8.x-1.x
    Issue #2394783 by marvin_B8: Drupal 8 Version Of Legal Module initial...
  • Robert Castelo committed 68efbef on 8.x-1.x
    Issue #2394783 by marvin_B8, edurenye, lomasr: Drupal 8 Version Of Legal...
robert castelo’s picture

Commited as part of today's London Drupal Sprint.

Special thanks to marvin_B8.

robert castelo’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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