Skip to content

Commit 114b10f

Browse files
malbertsclaude
andcommitted
Correct when Page Property Providers run
Providers also run from the RebuildGraphDatabases maintenance script, not only when a revision is stored, and a page whose last Subject was deleted keeps its subject slot, so providers keep running for it. The previous wording promised strictly edit-time invocation for subject-having pages only. Also smooth the paragraph flow around the content fields now that the intro sentence names them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d46f9c1 commit 114b10f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

docs/reference/extending.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ $registrar->addNeo4jValueBuilder( ColorType::NAME, static fn ( $value ) => $valu
7474
### Page Property Providers
7575

7676
Page Property Providers contribute key/value metadata to the Page node in the graph (queryable via Cypher;
77-
Neo4j is currently the only graph backend). They run when a revision is stored for a page that has Subjects;
78-
pages without Subjects are not stored in the graph, so providers are never invoked for them. Implement
79-
`PagePropertyProvider`:
77+
Neo4j is currently the only graph backend). They run when a revision is stored for a page carrying Subject
78+
data (including undeletions), and again for such pages when the graph is rebuilt with the
79+
`RebuildGraphDatabases` maintenance script. Pages without Subject data are not stored in the graph, so
80+
providers are never invoked for them. Implement `PagePropertyProvider`:
8081

8182
```php
8283
class StaticPagePropertyProvider implements PagePropertyProvider {
@@ -92,11 +93,11 @@ Register with `NeoWikiRegistrar::addPagePropertyProvider()`. The context exposes
9293
creation and modification times, categories, and last editor, as well as the page content and its parse
9394
products, so providers can derive Page Properties from the page content without re-fetching or re-parsing it.
9495

95-
To derive Page Properties from the content, prefer the parse products: `categories`, and
96+
To derive Page Properties from the content, prefer the parse products: `categories` and
9697
`parserProperties` — the MediaWiki page properties recorded during parsing (e.g. those a parser hook
9798
sets via `ParserOutput::setPageProperty`). These are template-expansion-safe and robust. (Note that
9899
`parserProperties` are an input from MediaWiki's parse; they are not the NeoWiki Page Properties this
99-
provider returns.) The raw main slot `content` and its `contentModel` are also exposed, but scraping
100+
provider returns.) The raw main slot `content` and its `contentModel` are the fallback: scraping
100101
raw wikitext is fragile — reach for them mainly when handling a custom, non-wikitext content model that
101102
the parse products do not cover. Example:
102103
[`src/StaticPagePropertyProvider.php`](https://github.com/ProfessionalWiki/NeoWiki/blob/master/tests/RedHerb/src/StaticPagePropertyProvider.php).

0 commit comments

Comments
 (0)