Skip to content

Converting a page to a block (removing its Page tag) leaves child blocks' :block/page pointing at the demoted block #1424

Closed

Description

@langzhou

Search first

  • I searched and no similar issues were found

What Happened?

In a DB graph, a page nested under another page can be converted to a block by removing its [[Page]] tag (the outliner validation allows page→block conversion when the page has a parent, is not under Library, and has no page children).

The conversion re-points the demoted block's own :block/page to the parent page, but its child blocks' :block/page still points to the demoted block — which is no longer a page. All descendants are left dangling:

;; after converting "Nested Page" (parent: "Demote Parent") to a block:

;; the demoted block itself — correctly re-pointed to the parent page
:block/page 193 ; "Demote Parent" ✓

;; its former child block — still pointing at the demoted, non-page block
:block/page 196 ; 196 = the demoted "Nested Page" block ✗

Consequences: the child blocks no longer belong to any real page, so they disappear from the parent page's content (page content is assembled via :block/page), and page-scoped features (linked references, queries, search scope, export) miss or misattribute them. The child blocks' :block/page should be re-pointed to the demoted block's parent page when the conversion happens.

Reproduce the Bug

  1. In a DB graph, create a page and nest it under another page (e.g. drag the page under a block of another page). Example: page "Nested Page" under page "Demote Parent"
  2. Add a block under "Nested Page", e.g. child block under nested page
  3. Open "Nested Page" and remove its [[Page]] tag (via the tag popup). The page converts to a block under "Demote Parent"
  4. Inspect the child block's :block/page (e.g. CLI: logseq show --id <block-id>, or a datascript query)
  5. It still points to the demoted "Nested Page" block instead of being re-pointed to "Demote Parent"

Expected Behavior

No response

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

Logseq Desktop v2.0.2

Additional Context

No response

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Activity

  1. added a commit that references this issue on Oct 22, 2026
    b759834
  2. yuxi-liu-wired commented on Oct 27, 2026

    @yuxi-liu-wired

    Fixed in logseq/logseq#13882 (fix(db): deleting or converting a node no longer leaves what depended on it broken). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.

  3. added 8 commits that reference this issue on Oct 29, 2026
    6970ac0
    38b303a
    bc3579e
    825da0b
    90741ff
    547b2de
    a4521d5
    1003875
  4. added 14 commits that reference this issue on Nov 11, 2026
    99366e5
    4bed366
    883766f
    4e1b1fb
    f40b85d
    f4a4438
    6e5e1d2
    69a4b67
    213d4d4
    bbeefa7
    426e15e
    74fa9fb
    ab30313
    2e167b0
  5. added a commit that references this issue on Nov 19, 2026
    b967c87
  6. added 2 commits that reference this issue on Nov 19, 2026
    1b69872
    7b393bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions