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

DOC Add changelog item for IsFirst/IsLast in elemental #631

Open
wants to merge 1 commit into
base: 5
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions en/08_Changelogs/5.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The `SilverStripe\CMS\Model\SiteTree.DESCRIPTION` localisation key (along with t
## API changes

- The class names for the `TopPage` feature in [`dnadesign/silverstripe-elemental`](https://github.com/silverstripe/silverstripe-elemental) do not follow the correct naming convention for Silverstripe CMS. The existing classes have been deprecated and will be renamed to match the correct naming convention in a future major release.
- For `BaseElement::First()` and `BaseElement::Last()` in [`dnadesign/silverstripe-elemental`](https://github.com/silverstripe/silverstripe-elemental) have been deprecated and `IsFirst()` and `IsLast()` have been added to replace them. This is to more closely match core template loop behaviour where `$IsFirst` and `$IsLast` have been used since CMS 5. These methods are commonly used in element templates, e.g. `<% if $First %>`/`<% if $Last %>`: please update usages to `<% if $IsFirst %>`/`<% if $IsLast %>`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use the same language as the other deprecations in the list.

Suggested change
- For `BaseElement::First()` and `BaseElement::Last()` in [`dnadesign/silverstripe-elemental`](https://github.com/silverstripe/silverstripe-elemental) have been deprecated and `IsFirst()` and `IsLast()` have been added to replace them. This is to more closely match core template loop behaviour where `$IsFirst` and `$IsLast` have been used since CMS 5. These methods are commonly used in element templates, e.g. `<% if $First %>`/`<% if $Last %>`: please update usages to `<% if $IsFirst %>`/`<% if $IsLast %>`.
- [`BaseElement::First()`](api:DNADesign\Elemental\Models\BaseElement::First()) has been deprecated. Use [`BaseElement::IsFirst()`](api:DNADesign\Elemental\Models\BaseElement::IsFirst()) instead.
- [`BaseElement::Last()`](api:DNADesign\Elemental\Models\BaseElement::Last()) has been deprecated. Use [`BaseElement::IsLast()`](api:DNADesign\Elemental\Models\BaseElement::IsLast()) instead.

- [`SilverStripe\ORM\ArrayLib`](api:SilverStripe\ORM\ArrayLib) has been deprecated. It will be renamed to `SilverStripe\Core\ArrayLib`
- [`SilverStripe\ORM\ArrayList`](api:SilverStripe\ORM\ArrayList) has been deprecated. It will be renamed to `SilverStripe\Model\List\ArrayList`
- [`SilverStripe\ORM\Filterable`](api:SilverStripe\ORM\Filterable) has been deprecated. It will be merged into [`SS_List`](api:SilverStripe\Model\List\SS_List).
Expand Down