cakePHP 4.0.0-beta3 possible bug

Checking 4-beta-3 against the CMS tutorial.

  1. created the database schema.
  2. ran the bin/cake bake all xxx to scaffold the app.
  3. ArticlesController->add() has the line:
    $tags = $this->Articles->Tags->find(‘list’, [‘limit’ => 200]);
    the SQL generated by this line is:
    SELECT Tags.id AS “Tags__id”, Tags.title AS “Tags__title” FROM tags Tags
    INNER JOIN articles_tags ArticlesTags ON Tags.id = (ArticlesTags.tag_id) LIMIT 200
  4. This does not appear to be correct for adding an Article. We just want a list of all Tags to populate the multiple select box…
  5. The SQL generated by cakePHP 3.8 for the same controller action line is:
    SELECT Tags.id AS “Tags__id”, Tags.title AS “Tags__title” FROM tags Tags
    i.e. just a list of all the tags.
    Even so, fantastic product keep up the good work.

This post is now irrelevant as the bug has been corrected in 4.0.0-beta4.

I noticed it too… Yes, it would do that where a belongs to and has many join would talk to each other