craftcms / craftcms/cms

Upgrading from Craft 2 to 3 kills asset search

Open
#4,875 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

After upgrading a site that's dependent on asset search, the default search for assets gives an "Undefined index: id" at line 1427 of ElementQuery.php

Steps to reproduce
  1. Upgrade site from 2 to 3 which contains many assets
  2. Attempt search
  3. Update all asset indexes to no avail
Additional info

After deleting assets, indexing, re-uploading and then re-indexing the search will work. That's not realistic with 10k PDFs

  • Craft version: 3.3.0.1
  • PHP version: 7.1.2
  • Database driver & version: MySQL 5.6.38
  • Plugins & versions: CP Field inspector, Freeform, Supertable, Simple Text

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.

Research direction

Start at ElementQuery.php line 1427 and reproduce the asset search failure after upgrading from Craft 2 to 3 with existing asset indexes. Trace the asset indexing and search path, using the reported deletion and re-upload behavior as a comparison. Done means searching existing assets works after migration and re-indexing without an undefined-index error.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
backend, databases, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.