Questions tagged [deprecation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
29 views

How to fix an error deprecated error for sourceID

In my CP I'm seeing an error that says: Elements’ getSourceId() method has been deprecated. Use getCanonicalId() instead. It references /storage/ad33d3/www/public_html/templates/jojojo/_sections/...
rudtek's user avatar
  • 149
1 vote
1 answer
39 views

Fixing Craft deprecation errors general question

I want to fix some deprecation errors on my site but would like to know a little more about how this works so that I know they are actually fixed and I haven't just cleared/hidden them. If I visit a ...
Helen Connole's user avatar
1 vote
1 answer
183 views

Upgrading Craft 3 to 4, deprecation warnings

I've just taken over a Craft 3 site that I'm upgrading to Craft 4. I've got 3 updates installed. I'm left with 5 deprecation warnings that are all (except one) coming from deep into the craftcms or ...
cbad's user avatar
  • 125
0 votes
0 answers
53 views

How do you Paginate if Looping through element queries directly is deprecated?

I want to create a basic product listing page based on categories. I created a template that dynamically shows all items based on the category that is passed to it based on the help I received here. ...
doctorgloom's user avatar
1 vote
2 answers
300 views

How to loop through multiple entries fields

I'm creating a dynamic side navigation where pages can choose which sidebar it wants to use. This is selected by an entries field called 'sidebar' - called in line 2. To create this I've made a ...
Jonathan's user avatar
1 vote
1 answer
368 views

craft.fields.getFieldByHandle() has been deprecated

I'm querying a dropdown field to loop through all of the options and followed best practice (so I thought) in the twig template. Does anyone know how to update for the deprecation below? Deprecation ...
Jon Goldman's user avatar
3 votes
2 answers
852 views

How can I tell if a variable is an array or an entry/element query?

We have some components that are used to build pages, like normal, and some where we hydrate them with other data, so we are passing in arrays instead of entries. If something is essentially an ...
Greg Bowne's user avatar
1 vote
1 answer
358 views

Looping through element queries directly has been deprecated

on the template _events.twig {% include "./components/_listing" with { entries: craft.entries.section('events').orderBy('eventStartDate ASC').limit(3), columns: 3, heading: 'On this month', ...
Sameera Thilakasiri's user avatar
3 votes
1 answer
709 views

How to duplicate entries and loop them without getting a Twig or deprecation error?

I'm trying to duplicate entries inside a macro, which will displays duplicated items inside a carousel. It's not possible to merge Element Queries. Even if it's possible to merge IDs, merging an ...
Romain P.'s user avatar
  • 1,808
1 vote
1 answer
1k views

Calling unknown method: craft\models\Section::hasUrls() - Craft 3 upgrade

I am migrating a site from Craft 2 - Craft 3. In my sitemap template I have the following code; {% for section in craft.sections.getAllSections() %} {# We only care about sections that have URLs #} ...
Terry Upton's user avatar
  • 1,884
1 vote
1 answer
483 views

Deprecation Errors - How to Fix?

We are in development of our new site in Craft 3 and we are getting some deprecation errors. This is keeping us from using Craft Commerce for our ordering page. Any suggestions on how to fix this? ...
Sam Sumpter's user avatar
1 vote
1 answer
228 views

Deprecation Error with No Error

I have a large site that I've finally got all the deprecation errors fixed except for 1. There is no origin. I opened up the stack trace but am unable to find which template the deprecated code is in....
CreateSean's user avatar
  • 1,963