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

API Stop using deprecated API #316

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions src/PageTypes/BasePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,8 @@ public function getFooter()
return FooterHolder::get_one(FooterHolder::class);
}

/**
* @deprecated 2.2.0 Use RelatedPagesThrough() instead
Copy link
Member Author

@emteknetnz emteknetnz Nov 24, 2022

Choose a reason for hiding this comment

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

Undeprecating because it's called a lot by templates in the starter theme. Given lots of project will have copied the theme files into their own theme, I think forcing templates to update this to <% loop $RelatedPagesThrough %> (which may not even work, and also just looks weird) is adding too much upgrade friction

*/
public function RelatedPages()
{
Deprecation::notice('2.2.0', 'Use RelatedPagesThrough() instead');
return $this->getManyManyComponents('RelatedPagesThrough');
}

Expand Down
2 changes: 1 addition & 1 deletion src/PageTypes/DatedUpdateHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static function AllUpdates(
} catch (DatabaseException $e) {
self::handleInvalidDateFormat($e);
// Ensure invalid SQL does not get run again
$items = $className::get()->limit(0);
$items = $className::get()->limit(null);
}

// Unpaginated DataList.
Expand Down
1 change: 0 additions & 1 deletion tests/PageTypes/DatedUpdateHolderControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ protected function setUp(): void

// Note: this test requires the starter theme to be installed
Config::modify()->set(SSViewer::class, 'themes', ['starter', '$default']);
Config::modify()->set(SSViewer::class, 'theme', 'starter');
}

public function testSettingDateFiltersInReverseOrderShowsMessage()
Expand Down
1 change: 0 additions & 1 deletion tests/PageTypes/SitemapPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ protected function setUp(): void
parent::setUp();

Config::modify()->set(SSViewer::class, 'themes', ['starter', '$default']);
Config::modify()->set(SSViewer::class, 'theme', 'starter');
}

/**
Expand Down