Role Based Theme switcher
===================

Role based Theme Switcher module help users to set
different themes for different Roles.

Configuration:
--------------
Role based Theme Switcher module have configuration setting page

Configuration page path: /admin/structure/role_based_theme_switcher/settings.

Dependencies:
-------------
This module depends on entity_reference, domain, options module.

Installation:
-------------
Install like any other module.

Project Url:
https://www.drupal.org/sandbox/pen/2760771

Project Git Url:
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/pen/2760771.git role_based_theme_switcher

Pareview.sh:
https://pareview.sh/node/765

Manual Review done for other Projects:
https://www.drupal.org/node/2850757#comment-11925087
https://www.drupal.org/node/2805677#comment-11920256
https://www.drupal.org/node/2851052#comment-11925416
https://www.drupal.org/node/2803167#comment-11858515
https://www.drupal.org/node/2805591#comment-11858637
https://www.drupal.org/node/2833336#comment-11838151

Comments

pen created an issue. See original summary.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

aloknarwaria’s picture

Category: Task » Bug report
Priority: Normal » Critical
Status: Active » Needs work

Hi @pen,
Module only works for admin only with fresh drupal 8.
Please fix the code for role base not the number roles base.

if(count($roles) > 1){
      $roles = end($roles);
    }
harsh.behl’s picture

Hi Alok,

I have updated the code in the module.
1. if you go to admin/structure/role_based_theme_switcher/settings url, you will find the list of roles in draggable format with list of themes in select list.choose the appropraite theme against specific role, that theme will be assigned to that particular role.

2. If a user has multiple roles, i.e authenticated, xyz, abc and all the roles have different themes in that case which ever role will be in the last in the list, will be assigned that particular theme.

you can find the changes in new dev branch.

Thanks for looking inti the module. :)

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

harsh.behl’s picture

Status: Closed (won't fix) » Needs review
PA robot’s picture

Status: Needs review » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2838572

Project 2: https://www.drupal.org/node/2828016

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

I'm a robot and this is an automated message from Project Applications Scraper.

harsh.behl’s picture

Issue summary: View changes
harsh.behl’s picture

Issue summary: View changes
Status: Closed (duplicate) » Needs review
harsh.behl’s picture

Priority: Critical » Normal
harsh.behl’s picture

Category: Bug report » Task
harsh.behl’s picture

Issue summary: View changes
PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

I'm a robot and this is an automated message from Project Applications Scraper.

harsh.behl’s picture

Issue tags: +PAreview: review bonus
ajalan065’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Hi,
The reviews you have done are not a proper manual review of the code.
Please do a proper review and add the tag

Now, coming to my observations and suggestions:
1. The file inside the config folder is empty. Remove it if not required.
2. In the RoleNegotiator.php, inject the services instead of using them directly.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

harsh.behl’s picture

Status: Closed (won't fix) » Needs review
harsh.behl’s picture

Issue summary: View changes
harsh.behl’s picture

@ajalan065,

I have solved all problems you have suggested. Thanks for reviewing.

harsh.behl’s picture

Issue summary: View changes
harsh.behl’s picture

Issue summary: View changes
harsh.behl’s picture

Issue tags: +PAreview: review bonus

klausi credited klausi.

klausi’s picture

Status: Needs review » Fixed

Review of the 8.x-1.x branch (commit cf46fc9):

  • DrupalPractice has found some issues with your code, but could be false positives.
    FILE: /home/klausi/pareview_temp/src/Form/AdminSettingsForm.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     88 | WARNING | Role::loadMultiple calls should be avoided in classes,
        |         | use dependency injection instead
    --------------------------------------------------------------------------
    
    
    FILE: /home/klausi/pareview_temp/src/Theme/RoleNegotiator.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    --------------------------------------------------------------------------
     60 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     73 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. project page: what are the differences to existing projects such as https://www.drupal.org/project/role_theme_switcher and https://www.drupal.org/project/tbr and https://www.drupal.org/project/themekey ? See also https://www.drupal.org/node/997024 . Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in any of the existing projects' issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.
  2. '--Select--' is user facing text and must run through $this->t() for translation.
  3. config name "role_based_theme_switcher.RoleBasedThemeSwitchConfig": why is this so long? You can simply use "role_based_theme_switcher"?
  4. config schema is missing for your config, see https://www.drupal.org/docs/8/api/configuration-api/configuration-schema...
  5. "ucfirst($id) . ' ' . $this->t('User'),": do not concatenate variables to translatable strings, use placeholders with $this->t() instead.
  6. AdminSettingsForm::validateForm(): what exactly are you validating here? "There are errors in the form" is a bad message, what is the exact problem and what should the user do instead?

But that are not super critical application blockers, otherwise looks good to me.

Thanks for your contribution, Harsh!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

harsh.behl’s picture

@klausi,

Thank you so much for the review. I have promoted this to a full project. Thanks for the time.

Harsh/Pen

Status: Fixed » Closed (fixed)

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