wintercms / winter

Free, open-source, self-hosted CMS platform based on the Laravel PHP Framework.
https://wintercms.com
MIT License
1.38k stars 195 forks source link

Calling partial() as a function to check for the existence of a partial fully executes the partial #263

Open LukeTowers opened 3 years ago

LukeTowers commented 3 years ago

Calling partial(path) as documented to determine if path exists and can be run as a partial fully executes the partial which includes any put statements (i.e. put scripts) which can lead to further issues like script resources added via put scripts being duplicated in the final output. See https://github.com/OFFLINE-GmbH/oc-microcart-plugin/blob/master/components/cart/payment_data.htm#L3 for an example of an affected plugin.

bennothommo commented 3 years ago

@LukeTowers while we could certainly change the behaviour of the partial() method, it might be being used (somewhat incorrectly) to load partials and therefore could be a breaking change.

I think we might have to, in this instance, create a new method (perhaps exists()) that checks existence and update the docs to indicate the true behaviour of the partial method.

LukeTowers commented 3 years ago

@bennothommo yeah, that's what I was thinking, something like partialExists(), pageExists(), etc

github-actions[bot] commented 3 years ago

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

github-actions[bot] commented 2 years ago

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

github-actions[bot] commented 2 years ago

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

github-actions[bot] commented 2 years ago

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

github-actions[bot] commented 2 years ago

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at wintercms@luketowers.ca.

github-actions[bot] commented 1 year ago

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at wintercms@luketowers.ca.

github-actions[bot] commented 1 year ago

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months. If this issue is still relevant or you would like to see it actioned, please respond within 3 days. If this issue is critical for your business, please reach out to us at wintercms@luketowers.ca.