Skip to content

Page and Block Search Missing Entries in MD graph #9

@0WD0

Description

@0WD0

Search first

  • I searched and no similar issues were found

What Happened?

Page and Block Search Missing Entries in MD graph

Reproduce the Bug

switch to a md graph (db version but md graph)
type in [[...]] or ((...)) to search page or block (actually no difference)

Expected Behavior

No response

Files

No response

Browser, Desktop or Mobile Platform Information

No response

Additional Context

I find a solution

in src/main/frontend/components/editor.cljs

(defn- search-pages
  [q db-tag? db-based? set-matched-pages!]
  (when-not (string/blank? q)
    (p/let [block (db-async/<get-block (state/get-current-repo) q {:children? false})
            result (if db-tag?
                     (let [classes (editor-handler/get-matched-classes q)]
                       (if (and (ldb/internal-page? block)
                                (= (:block/title block) q))
                         (cons {:block/title (util/format "Convert \"%s\" to tag" q)
                                :db/id (:db/id block)
                                :block/uuid (:block/uuid block)
                                :convert-page-to-tag? true} classes)
                         classes))
                     (editor-handler/<get-matched-blocks q {:nlp-pages? true
                                                            :page-only? (not db-based?)}))] ;; changing this parameter to false will solve the problem
      (set-matched-pages! result))))

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

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

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