Skip to content

Show full error messages when include_object_name is set - #3540

Merged
parndt merged 1 commit into
fix/engine-generator-frontend-pathfrom
fix/error-messages-full-message
Nov 9, 2026
Merged

parndt merged 1 commit into
fix/engine-generator-frontend-pathfrom
fix/error-messages-full-message

Conversation

@parndt

@parndt parndt commented Nov 9, 2026

Copy link
Copy Markdown
Member

When #3518 moved to the Rails 7 errors API, both branches of refinery/admin/_error_messages started rendering error.message. The include_object_name branch used to render full_messages, so forms now show "can't be blank" instead of "Title can't be blank". 4.1.0 shipped with this.

include_object_name: true is used by crudify, the pages and images admin, and the engine generator's _form template. The generator's spec template expects "Title can't be blank", so newly generated extensions fail their own feature specs. It also breaks two password-reset specs in refinerycms-authentication-devise (refinery/refinerycms-authentication-devise#56).

Change

  • Render error.full_message in the include_object_name branch
  • Add a pages admin system spec that saves a page with a blank title and expects "Title can't be blank". It fails without the change.

parndt added a commit to refinery/refinerycms-authentication-devise that referenced this pull request Nov 9, 2026
Points Rails 7.2+ at refinery/refinerycms#3540 (b2d9fed) so the password
reset specs prove the fix. Return to branch: "main" once it merges.
@parndt parndt changed the title Show full error messages when include_object_name is set Show full error messages when include_object_name is set Nov 9, 2026
@parndt
parndt force-pushed the fix/error-messages-full-message branch from 393d825 to e91804c Compare November 9, 2026 10:17
@parndt
parndt changed the base branch from main to ci/test-dependencies November 9, 2026 10:17
@parndt
parndt added this pull request to stack #3542 November 9, 2026 10:18
The Rails 7 errors API update (03edec5) changed the include_object_name
branch of _error_messages from full_messages to error.message, so forms
showed "can't be blank" instead of "Title can't be blank". crudify, the
pages and images admin, and the engine generator's form template all
rely on this branch.
@parndt
parndt force-pushed the fix/error-messages-full-message branch from e91804c to fd344bb Compare November 9, 2026 10:34
@parndt
parndt removed this pull request from stack #3542 November 9, 2026 10:35
@parndt
parndt changed the base branch from ci/test-dependencies to fix/engine-generator-frontend-path November 9, 2026 10:35
@parndt
parndt added this pull request to stack #3544 November 9, 2026 10:35
@parndt
parndt merged commit faeb5d9 into main Nov 9, 2026
509 of 510 checks passed
@parndt
parndt deleted the fix/error-messages-full-message branch November 9, 2026 20:30
parndt added a commit to refinery/refinerycms-authentication-devise that referenced this pull request Nov 10, 2026
Points Rails 7.2+ at refinery/refinerycms#3540 (b2d9fed) so the password
reset specs prove the fix. Return to branch: "main" once it merges.
parndt added a commit to refinery/refinerycms-authentication-devise that referenced this pull request Nov 17, 2026
This brings the extension up to date with refinerycms `main` and gets
the CI matrix green across Ruby 3.2–4.0 and Rails 6.1, 7.2, 8.0 and 8.1,
on sqlite, MySQL and Postgres.

The Gemfile now tracks refinerycms `main` rather than `master`, and
takes the Rails version from `RAILS_VERSION`. On Rails 8.0 and earlier,
`json` stays below 3, because ActiveSupport still passes `quirks_mode`
to `JSON.generate` and json 3 rejects it. For Ruby 3.4, older Rails gets
`mutex_m` back, and the Rakefile requires `logger` and uses
`File.exist?`.

Two fixes were needed for newer Rails and rspec. The admin
`UsersController` has no `show` action, but `crudify` registered a find
callback for it, which Rails 7.1+ refuses; passing `exclude_from_find:
:show` sorts that out. In the specs, rspec-core 3.13 applies
`config.extend` before `config.include`, so including
`Devise::Test::ControllerHelpers` from `ControllerMacros.extended` ran
before rspec-rails had defined `setup`. It's now included through
`config.include` instead.

The password-reset specs were also failing because core's
`_error_messages` partial dropped the attribute name, showing "is
invalid" rather than "Reset password token is invalid". That was fixed
in refinery/refinerycms#3540, which has now merged.

Finally, there's a trusted-publishing release workflow, so pushing a
`v*` tag builds the gem and publishes it to RubyGems.org. It runs in the
`release` environment, which only `v*` tags can deploy to.

Closes #51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant