Skip to content

Conversation

@solracsf
Copy link
Member

@solracsf solracsf commented Nov 23, 2024

Checklist

@joshtrichards
Copy link
Member

joshtrichards commented Nov 23, 2024

LOL I just wrote basically the same code and was about to shoot over the PR:

	private function getTemplateFolder(): Node {
		if ($this->getTemplatePath() !== '') {
			$userTemplateFolder = $this->rootFolder->getUserFolder($this->userId)->get($this->getTemplatePath());
			if ($userTemplateFolder->getType() === \OCP\Files\FileInfo::TYPE_FOLDER) {
				return $userTemplateFolder;
			}
		}
		throw new NotFoundException();
	}

Both re-trigger the new template folder setup setting (good). I didn't make the exception message more verbose though. Since it's caught silently when used in getTemplateFiles() I think re-triggering the Create new template folder option is enough (but won't hurt!).

Copy link
Member

@joshtrichards joshtrichards left a comment

Choose a reason for hiding this comment

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

Tested/works.

@solracsf
Copy link
Member Author

I didn't make the exception message more verbose though.

I've added a separate log line instead, could help when user expects something but get nothing and can't understand why.

@solracsf solracsf requested review from a team, ArtificialOwl, icewind1991 and provokateurin and removed request for a team December 13, 2024 08:18
@solracsf
Copy link
Member Author

/backport to stable30

@solracsf
Copy link
Member Author

/backport to stable29

@solracsf solracsf force-pushed the ensureTemplateFolder branch from cd4c53b to efa615b Compare December 13, 2024 10:27
@solracsf solracsf merged commit ace16c1 into master Dec 16, 2024
185 of 188 checks passed
@solracsf solracsf deleted the ensureTemplateFolder branch December 16, 2024 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants