Problem/Motivation

Currently, the form at user/UID/workbench_access doesn't give any change confirmation message on save.

Steps to reproduce

Assign a user to a section -- no message.

Proposed resolution

Add a message!

Remaining tasks

Add a message!

User interface changes

A message appears.

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

agentrickard created an issue. See original summary.

omkar-pd made their first commit to this issue’s fork.

omkar-pd’s picture

Status: Active » Needs review

Added Confirmation message on user/UID/workbench_access.

agentrickard’s picture

Status: Needs review » Needs work

Not sure why those tests failed.

We should also inject the messenger service.

And the message should probably indicate the nature of the change, such as "added 2 sections" or "removed 1 section" or a list of add/remove.

agentrickard’s picture

Status: Needs work » Needs review
StatusFileSize
new2.74 KB

The form processing doesn't really tell us what was added/removed, so just a confirm is fine.

omkar-pd’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, moving this to RTBC.

omkar-pd’s picture

We should also use Dependency Injection in other files as well. Let's fix that in another issue once this issue is fixed.

agentrickard’s picture

If you take a look at the README in the -dev branch, you'll see that is not currently required, but we should spin up a new ticket.

tl;dr; Here's what I'm testing with using PHPSTAN (in phpstan.neon):

parameters:
  level: 2
  ignoreErrors:
    # new static() is a best practice in Drupal, so we cannot fix that.
    - "#^Unsafe usage of new static#"
    # Ignore common errors for now.
    - "#Drupal calls should be avoided in classes, use dependency injection instead#"
    # Ignore PHPUnit Prophecy class reflection errors.
    - "#^Call to an undefined method Prophecy#"
  drupal:
    entityMapping:
      access_scheme:
        class: Drupal\workbench_access\Entity\AccessScheme
        storage: Drupal\Core\Entity\ContentEntityStorageBase
      section_association:
          class: Drupal\workbench_access\Entity\SectionAssociation
          storage: Drupal\workbench_access\SectionAssociationStorage

  • agentrickard committed 5d68148 on 8.x-1.x
    Issue #3307172 by omkar-pd, agentrickard: Add message on uiser...
agentrickard’s picture

Status: Reviewed & tested by the community » Fixed
agentrickard’s picture

Status: Fixed » Closed (fixed)

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