cfdp / opeka

Counseling chat service, built for providing anonymous help to young people at risk
https://curachat.com
GNU General Public License v3.0
10 stars 6 forks source link

Upgrade Opeka module to Drupal 8 #119

Open benjamin-dk opened 6 years ago

benjamin-dk commented 6 years ago

The Opeka module and submodules should be upgraded.

The priorities are as follows

  1. Upgrade main module, making sure the following features work
    • Migrate stored data of main module from D7
    • Admin pages - forms and database getting and setting values
    • Various values to be added as JS variables (opeka_add_assets)
    • Widget pages should work
    • Statistics functionality
    • Backbone.js integration
  2. Opeka Screening submodule
  3. Opeka Opening Hours
  4. Opeka Invites
  5. Opeka Features

An upgraded version of the Bootstrap theme can be found here (a subtheme to Bootstrap 3): https://github.com/cfdp/cura-chat-theme/tree/release/v2.0

stefanospetrakis commented 6 years ago

What was done:

stefanospetrakis commented 6 years ago

The Drupal 8 version of the node-drupal code is available here https://github.com/stefanospetrakis/node-drupal/tree/drupal8 Once reviewed, this could be used in the package.json:

https://github.com/cfdp/opeka/blob/feature/drupal8_refactor/nodejs/package.json#L25

stefanospetrakis commented 6 years ago

Moved current work on this to a branch of master, in order to 'link' to the latest state of work in D7. The latest commit "21a504ba8bd5aa8ab009ae31229acad9758913af" delivers:

benjamin-dk commented 6 years ago

Hi @stefanospetrakis it seems we have an issue with the authentication of some user roles / permissions.

When logging in as user 1 I get the expected permissions, but when creating e.g. a counselor role and granting the permission administer opeka chat(or even all opeka-related permissions) to a user, this user does not have access to the counselor methods.

I noticed that Opeka.clientData has two properties, admin and isAdmin being true and false. The issue lies here probably.

screen shot 2018-04-06 at 09 55 55

Server-side the user.authenticate process goes haywire in the drupal.user.access callbacks - they end up sending 1024 callbacks to front end.

Investigation continues...

gvd1 commented 6 years ago

The problem stems from the node-drupal module - I made a PR here https://github.com/stefanospetrakis/node-drupal/pull/1 it should fix the permissions issue.

We still have a problem with too many callbacks.

stefanospetrakis commented 6 years ago

@gvd1 I am investigating this too, will look at the related PR soon.

stefanospetrakis commented 6 years ago

@gvd1 The problem with the permissions of (non-admin) users has been resolved, could you confirm the fix works for you?