Problem/Motivation

You get various exceptions if you try to use the module without having configured the MJML API credentials.

Steps to reproduce

Install the module and don't configure it.
Browse to /mjml_preview/render/42

Proposed resolution

If the API credentials are not configured yet we could:

  • Hide the local tasks
  • Return a correct HTTP code on the download and preview routes (404?)

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#3 mjml_preview-3564190.patch1.89 KBshank115
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

prudloff created an issue. See original summary.

shubham_pareek_19’s picture

I was able to reproduce this locally. When the module is enabled and a valid node ID is used (for example /mjml_preview/render/1), the route is resolved correctly, but if the MJML API credentials are not configured yet, the request results in “The website encountered an unexpected error.”
This is not a 404 or routing issue—the controller is reached and fails due to missing configuration. Handling this case more gracefully (for example by hiding local tasks or returning a clean response when MJML is not configured) would improve the user experience on fresh installs.

please update issue summary.

shank115’s picture

Status: Active » Needs review
StatusFileSize
new1.89 KB

This patch hides MJML Preview and Download tabs until MJML is configured.

prudloff’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • prudloff committed 3bef9a49 on 1.x
    feat: #3564190 Avoid errors when module is not configured yet
    
    By:...

Status: Fixed » Closed (fixed)

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