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

Upon creation a FieldsetPage’s output formatting is on because of parent #1825

Closed
romaincazier opened this issue Oct 6, 2023 · 2 comments

Comments

@romaincazier
Copy link

Short description of the issue

When creating a page with a FieldsetPage, this FieldsetPage’s output formatting is turned on because of its forPage.

Suggestion for a possible fix

I don’t know if there would be unexpected consequences to this but adding a check against isNew solves this issue:

53	// mirror the output formatting state of the owning page
54	if($this->forPage && !$this->getOf && !$this->isNew) {
55		$of = $this->forPage->of();
56		if($of != $this->of()) $this->of($of); 
57	}

Setup/Environment

  • ProcessWire version: 3.0.227

How it came to be an issue

In a project I’m working on I need to export / import pages but also in-between make changes to accomodate the new structure. These pages contain a (necessary) mess of FieldsetPages/RepeaterPages/RepeaterMatrixPages with some being within others.

During the import, I’m facing an issue right at the creation of the page, even with a simple $pages->new("my-template").

My template (short version) is as such:

my-template
↳ my-fieldsetpage
  ↳ my-other-fieldsetpage
    ↳ my-table

The creation fails because of FieldtypeTable complaining during the ___sleepValue() call that the value is formatted. Normally this is ignored thanks to this try/catch, but in my setup, for a reason I do not understand, $config->allowExceptions ends up being true and blocks my import script, and yet, somehow, with a simplified case it doesn’t, scratch that it’s because of one of TracyDebugger’s latest update setting $config->allowExceptions to true (see this issue).

@adrianbj
Copy link

adrianbj commented Oct 6, 2023

@romaincazier - sorry that change to Tracy has confounded things for you. I'll wait for @ryancramerdesign to chime in first before I change anything though if that's ok.

ryancramerdesign pushed a commit to processwire/processwire that referenced this issue Oct 11, 2023
@ryancramerdesign
Copy link
Member

@romaincazier I'm not sure how to duplicate the issue, but the suggestion seems to make sense even without the issue, so I have added it. Thanks!

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

3 participants