silverstripe / cwp

Common Web Platform (CWP) features module. We strongly recommend using it for all new CWP projects. Future features will be delivered here.
https://www.cwp.govt.nz
BSD 3-Clause "New" or "Revised" License
10 stars 27 forks source link

Related Pages publishes Draft pages #303

Closed amolswnz closed 3 years ago

amolswnz commented 3 years ago

Steps to reproduce

  1. 'Page A' - Make this page as Draft
  2. 'Page B' Goto "Related Pages"
  3. Add link to 'Page A'
  4. Publish 'Page B'
  5. 'Page A' is transitioned from 'Draft' to 'Publish'

Expected

Draft pages should not publish.

Version

cwp/cwp                                                  2.7.1     CWP features module. We strongly recommend using it for all new si...
cwp/cwp-core                                             2.7.1     CWP basic compatibility module. Use for migrations.
cwp/cwp-pdfexport                                        1.1.1     Add PDF export capability for pages in CWP
cwp/cwp-recipe-cms                                       2.7.1     CWP CMS requirements recipe
cwp/cwp-recipe-core                                      2.7.1     CWP core requirements recipe
cwp/cwp-recipe-search                                    2.7.1     CWP search requirements recipe
cwp/cwp-search                                           1.4.0     CWP fulltextsearch integration module
silverstripe/cms                                         4.7.1     The SilverStripe Content Management System
silverstripe/framework                                   4.7.3     The SilverStripe framework
maxime-rainville commented 3 years ago

That's expected behaviour because RelatedPages is a owned relation of BasePage.

https://github.com/silverstripe/cwp/blob/2f95b270d9cc1ae68c4bdc99c4789eaeb68077df/src/PageTypes/BasePage.php#L69-L71