loadsys / loadsys/CakePHP-LoadsysTheme

Baked Table::buildRules() rules are too brief.

Open
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

You get something like this:

``` php
$rules->add($rules->isUnique(['email']));
```

When really we want something like this:

``` php
$rules->add(
$rules->isUnique(['email']),
'email-is-unique',
[
'errorField' => 'email',
'message' => 'That email address already exists.',
]
);
```

Without those additional properties, the rule will cause a `save()` to fail, but will **not** report the error anywhere (not even in DebugKit). This is not an acceptable "default" level of quality. We should have the choice to reduce the "verbosity" of the messages, not be forced to add it by rote. That's the whole point of having bake templates, after all.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Bake Table::buildRules() template or entry point that produces the shown PHP. Compare its generated rule with the requested named rule and additional properties. Done means generated rules include the requested error metadata and a save() failure reports the error, including in DebugKit.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.