Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 3.7.21 breaks custom field #10205

Closed
Timusan opened this issue Dec 3, 2021 · 8 comments
Closed

Upgrading to 3.7.21 breaks custom field #10205

Timusan opened this issue Dec 3, 2021 · 8 comments
Labels

Comments

@Timusan
Copy link

Timusan commented Dec 3, 2021

Description

I have a custom field which holds a Lat/Lng coordinate of an entry.
After upgrading Craft to 3.7.21 I get the following output when querying the field:

 "error": "Setting unknown property: craft\\elements\\Entry::myCoordinate",
  "exception": "yii\\base\\UnknownPropertyException",
...

It suddenly does not know that myCoordinate is a field on the entry.
When I downgrade back to 3.7.20 everything works as expected.
The entity query I am doing is pretty straightforward:

$entries = Entry::find()
  ->section('mySection')
  ->myCoordinate([
    'lat' => $lat,
    'lng' => $lng,
    'range' => $range,
  ]);

Did something change between 3.7.20 and 3.7.21 which could cause custom fields to be treated differently in entry queries?

Additional info

  • Craft version: 3.7.21
  • PHP version: 8.0.12
  • Database driver & version: PostgreSQL - 13
@Timusan Timusan added the bug label Dec 3, 2021
@brandonkelly
Copy link
Member

Try deleting your storage/runtime/compiled_classes/ directory.

@Timusan
Copy link
Author

Timusan commented Dec 3, 2021

Thanks for the reply.

Unfortunately, the error remains after deleting storage/runtime/compiled_classes/.

@brandonkelly
Copy link
Member

Are you 100% sure you’ve spelled the field handle correct, and are using the correct casing? If so, please send in a database backup and your composer.json + composer.lock files to support@craftcms.com and we can look into it from there.

@Timusan
Copy link
Author

Timusan commented Dec 3, 2021

I am 100% as switching back to an older version of Craft makes it work perfectly, then switching back to 3.7.21 breaks it again. The custom field code never changes in between switches.

Thanks for the offer of looking into this. I'll discuss this with my team on Monday, as this regards a fairly large project including custom modules and (business) code. Without these custom modules (the field affected by this issue being one of them) you cannot reproduce it I'm afraid.

@brandonkelly
Copy link
Member

If it helps, we might be able to reproduce with just your project config data, rather than a full DB backup. If you want to go that route, just run php craft project-config/rebuild first, then zip up your config/project/ folder.

@Timusan
Copy link
Author

Timusan commented Dec 6, 2021

Done! I have justed tarred the config/project directory and send it your way.

@brandonkelly
Copy link
Member

Thanks! We were able to reproduce, and have fixed this for the next release.

To get the fix early, change your craftcms/cms requirement in composer.json to "dev-develop as 3.7.25.1" and run composer update.

@brandonkelly
Copy link
Member

Craft 3.7.26 is out now with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants