craftcms / craftcms/cms

[5.0.0-beta.10]: Asset::find()->hasAlt() fails

Open
#14,640 1 comment 0 reactions 1 assignee View on GitHub

@i-just is already working on this.

Since Mar 21, 2024.

bug
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description
$hasNoAlt = Asset::find()
            ->site('*')
            ->folderId($folder->id)
            ->kind('image')
            ->hasAlt(false)
            ->exists();

gives Column not found: 1054 Unknown column 'assets_site.alt' in 'where clause''

Obviously there is a typo in https://github.com/craftcms/cms/blob/76d52ef1d14884b9a0ada83297f7f4a17687aa7a/src/elements/db/AssetQuery.php#L973

Fixing this typo results in Column not found: 1054 Unknown column 'elements_sites.siteId' in 'on clause'

Craft CMS version

Craft Solo 5.0.0-beta.10

PHP version

8.2.13

Operating system and version

Linux 5.15.133.1-microsoft-standard-WSL2

Database type and version

MySQL 8.0.33

Image driver and version

No response

Installed plugins and versions

No response

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.