Skip to content

Tags: cakephp/bake

Tags

3.8.1

Toggle 3.8.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #1098 from cakephp/feat-command-description

Add short descriptions to bake commands

3.8.0

Toggle 3.8.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #1097 from cakephp/3.next

3.next

3.7.1

Toggle 3.7.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Skip self-referencing associations for unconstrained keys (#1094)

A column following the `<table>_id` naming on its own table (such as an
external `system_id` on a `systems` table) made bake generate a
self-referencing association whose alias equals the table's own name.
The generated belongsTo and hasMany/hasOne then collided, and applying
them threw "Association alias `Systems` is already set", aborting the
bake run.

Self-references are now only generated when the column is actually
constrained as a foreign key to the same table. Legitimate self-refs
such as `parent_id` keep their existing dedicated aliases, while
convention-only `<table>_id` columns without a real constraint are
skipped across the belongsTo, hasOne and hasMany detection passes.

3.7.0

Toggle 3.7.0's commit message
Merge branch '3.x' into 3.next

3.6.4

Toggle 3.6.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix command name. (#1082)

As seen in the default value for `BaseCommand::$name` and asserted
in `BaseCommand::setName()`, the command names need a "root" part
which is usually "cake".

3.6.3

Toggle 3.6.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix singular/plural variable collision in baked templates (#1075)

* Fix singular/plural variable collision in baked templates

When baking templates for models where the singular and plural forms are
identical (e.g., "news", "sheep", "fish"), the generated foreach loops
would incorrectly use the same variable for both the collection and the
iteration variable, producing invalid code like:

    foreach ($news as $news):

This fix appends "Item" to the singular variable name when a collision
is detected, producing valid code:

    foreach ($news as $newsItem):

Refs https://discourse.cakephp.org/t/paginator-error/12806/4

* Fix additional singular/plural variable collisions

- Change suffix from 'Item' to 'Entity' (less likely to collide with
  model names like 'NewsItem')
- Add same fix to ControllerCommand for controller action generation
- Add collision detection in view.twig for related entity loops
  (appends 'Related' suffix when otherSingularVar matches singularVar)
- Add collision detection in Controller/add.twig and edit.twig for
  association list variables (appends 'List' suffix when otherPlural
  matches singularName)
- Add test for ControllerCommand singular/plural collision handling

3.6.2

Toggle 3.6.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #1072 from cakephp/issue-1071

Fix path check on Windows.

3.6.1

Toggle 3.6.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #1070 from othercorey/patch-1

Fix checking references int non-foreign constraints

3.6.0

Toggle 3.6.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #1068 from cakephp/composite-unique-messages

Add descriptive error messages for composite unique constraints

3.5.1

Toggle 3.5.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #1061 from cakephp/bump-twig-view-constraint

Bump twig-view constraint