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

Add SiteTree::$hide_pagetypes configuration property #1805

Closed
sminnee opened this issue Apr 27, 2017 · 7 comments
Closed

Add SiteTree::$hide_pagetypes configuration property #1805

sminnee opened this issue Apr 27, 2017 · 7 comments

Comments

@sminnee
Copy link
Member

sminnee commented Apr 27, 2017

Acceptance criteria

  • SiteTree has a $hide_pagetype config value which accepts SiteTree subclass class names in an array
  • $hide_ancestor is deprecated
  • The new configuration property gets defined directly on SiteTree via yaml config - defining it on subclasses has no effect
  • classes in that array will not be available in the CMS when selecting page type, for any user.
  • Unit tests pass
  • Docs exist and are correct

PRs

@sminnee sminnee added this to the CMS 4.0.0-beta1 milestone Apr 27, 2017
@tractorcow
Copy link
Contributor

This is essentially a tweak of hide_ancestor, so it should be a simple rename / refactor.

@tractorcow
Copy link
Contributor

/**
     * If you extend a class, and don't want to be able to select the old class
     * in the cms, set this to the old class name. Eg, if you extended Product
     * to make ImprovedProduct, then you would set $hide_ancestor to Product.
     *
     * @config
     * @var string
     */
    private static $hide_ancestor = null;

@sminnee
Copy link
Member Author

sminnee commented Apr 27, 2017

Yeah I think we can ditch hide_ancestor favour of this mechanism.

@chillu
Copy link
Member

chillu commented Jun 28, 2017

Removing from milestone, it's a new API. The old (replaced) API can be deprecated instead of removed once we get around to that in the 4.x release line.

@chillu chillu removed this from the Recipe 4.0.0-beta1 milestone Jun 28, 2017
@pxwee5
Copy link

pxwee5 commented Apr 10, 2018

As of SS4.1@stable, there's no depreciation notice on $hide_ancestor nor any implementation of $hide_pagetype.

As much as I believe $hide_pagetype is more intuitive to use and have no dependencies on parent classes, please give enough depreciation notice/time before we completely drop the $hide_ancestor configuration.

@tractorcow
Copy link
Contributor

Don't worry, if we deprecate it, it will still work perfectly fine until 5.0 at least. Deprecation notices won't show on deprecated APIs unless you opt in by the way.

// Set to 5.0.0 to show APIs marked for removal at that version
Deprecation::notification_version('4.0.0');

@sabina-talipova
Copy link
Contributor

Solution was implemented. Issue is closed.

@sabina-talipova sabina-talipova removed their assignment Nov 5, 2023
@GuySartorelli GuySartorelli changed the title Add SiteTree::$hide_pagetype setting Add SiteTree::$hide_pagetypes configuration property Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants