1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-01 20:00:37 +02:00

Fixed bug when transform pages to posts (getFullDraftNavigation)

This commit is contained in:
trendschau
2024-12-12 23:09:14 +01:00
parent f74813cd69
commit 6cd6587f15
3 changed files with 5 additions and 4 deletions

View File

@@ -130,6 +130,7 @@ class ControllerApiAuthorMeta extends Controller
$langattr = $this->settings['langattr'];
$navigation = new Navigation();
$item = $navigation->getItemForUrl($params['url'], $urlinfo, $langattr);
if(!$item)
{
$response->getBody()->write(json_encode([
@@ -234,13 +235,13 @@ class ControllerApiAuthorMeta extends Controller
# RECREATE ITEM AND NAVIGATION, because we rename filename first and later update the meta-content
$draftNavigation = $navigation->getFullDraftNavigation($urlinfo, $this->settings['langattr']);
$draftNavigation = $navigation->setActiveNaviItemsWithKeyPath($draftNavigation, $item->keyPathArray);
$item = $navigation->getItemWithKeyPath($draftNavigation, $item->keyPathArray);
$item = $navigation->getItemWithKeyPath($draftNavigation, $item->keyPathArray);
}
}
# if folder has changed and contains pages instead of posts or posts instead of pages
if($item->elementType == "folder" && isset($params['data']['contains']) && isset($metadata['meta']['contains']) && $this->hasChanged($params['data'], $metadata['meta'], 'contains'))
{
{
if($meta->folderContainsFolders($item))
{
$response->getBody()->write(json_encode([

View File

@@ -159,7 +159,7 @@ class Navigation extends Folder
$foldername = $this->getNaviFileNameForPath($pageinfo['path']);
$draftNavigation = $this->getDraftNavigation($urlinfo, $langattr, $foldername);
$draftNavigation = $this->getFullDraftNavigation($urlinfo, $langattr, $foldername);
if(!$draftNavigation)
{
return false;

View File

@@ -905,7 +905,7 @@ class Storage
##################
public function transformPagesToPosts($folder)
{
{
$filetypes = array('md', 'txt', 'yaml');
$result = true;