Topic on Talk:Structured Discussions

Works in One NS, Fails in Another NS

7
Summary by Johnywhy

The are different fixes, depending on the source of the problem:

Wrong Custom-Namespace Declaration Order

The Flow declares must go after the declare for a custom namespace. Correct order is:

define("NS_PORTAL_TALK", 3005); 
$wgExtraNamespaces[NS_PORTAL_TALK] = "Portal_Talk"; 
$wgNamespaceContentModels[NS_PORTAL_TALK] = 'flow-board';

Wrong Native Constants

Pages in the Main namespace are simply NS_TALK, not NS_MAIN_TALK. The correct declare is:

$wgNamespaceContentModels[NS_TALK] = 'flow-board';	

Non-Registered Extension Constants

Extension:Page_Forms namespace constant is supposed to be PF_NS_FORM_TALK. But that constant does not work in the Flow declare-- you must use the actual number: 107. This works:

$wgNamespaceContentModels[107] = 'flow-board';	

It's unknown to me whether Page_Forms failed to register its constants correctly, or whether all extension must use numbers (not constants) with Flow.

Old Remnants

If you're correctly getting Flow in a namespace, except for one page in that namespace, there may be remnant junk in the talk page (even if it appears empty). Do the following:

  1. Browse to the talk page that won't load Flow, eg: Portal_Talk:Welcome
  2. Delete the Talk page using the Delete tab.
  3. Go to the content page for that talk page, eg: Portal:Welcome
  4. Click Discuss.
  5. You get Flow.
Johnywhy (talkcontribs)

I'm getting Flow in one namespace, but seeing old built-in editor in another namespace. But BOTH are set to use Flow:

wfLoadExtension( 'Flow' );
wfLoadExtension( 'Echo' );
$wgNamespaceContentModels[NS_DRAFT_TALK] = 'flow-board';		# WORKS FOR THIS NS
$wgNamespaceContentModels[NS_PORTAL_TALK] = 'flow-board';	# FAILS FOR THIS NS

What's my mistake?

Jdforrester (WMF) (talkcontribs)

How are NS_DRAFT_TALK and NS_PORTAL_TALK defined, and where? Are they defined at the same point, and is it before this code is executed?

Johnywhy (talkcontribs)

i updated the manual page here: Extension:StructuredDiscussions#Installing

"Important: You must put the Flow declaration after any namespace protections (even if they don't include TALK). Otherwise, flow may fail for some namespaces."

Feel free to revise as needed.

Johnywhy (talkcontribs)

Solved.

The fix was moving these ns protections before the Flow declaration (even though _TALK does not appear here):

$wgNamespaceProtection[NS_PORTAL] =
$wgNamespaceProtection[NS_PROJECT] =
$wgNamespaceProtection[NS_HELP] =
$wgNamespaceProtection[NS_CATEGORY] =
$wgNamespaceProtection[NS_FORM] = array( 'editprotected' );

$egApprovedRevsNamespaces[] = NS_DRAFT;

Here are the namespace declarations in LocalSettings.php. This was already before the Flow declarations, so no change needed with that:

# DRAFT NAMESPACE
define("NS_DRAFT", 3000); // This MUST be even.
$wgExtraNamespaces[NS_DRAFT] = "Draft";
define("NS_DRAFT_TALK", 3001); // This MUST be the following odd integer.
$wgExtraNamespaces[NS_DRAFT_TALK] = "Draft_Talk"; // Note underscores in the namespace name.

# PORTAL NAMESPACE (PROTECTED.)
define("NS_PORTAL", 3004); // This MUST be even.
$wgExtraNamespaces[NS_PORTAL] = "Portal";
define("NS_PORTAL_TALK", 3005); // This MUST be the following odd integer.
$wgExtraNamespaces[NS_PORTAL_TALK] = "Portal_Talk"; // Note underscores in the namespace name.
Johnywhy (talkcontribs)

plz see my new edits to the manual page. Tried to give it some better organization-- -not sure it's clear.

i think the phrase "put the flow declaration at the bottom of localsettings.php" is very UNhelpful, since MANY extensions say the same thing!

It's more useful to explain exactly which declares must come before the Flow declare.

Johnywhy (talkcontribs)

Oops. Not solved. I was mistaken.

I'm getting Flow on all expected pages EXCEPT HOMEPAGE.

The homepage is a redirect from Main_Page, and it's namespace is Portal, not Main.

It's called Portal:Welcome https://gunretort.xyz/index.php/Portal:Welcome

All other talk pages in Portal namespace are getting Flow, but not Portal_Talk:Welcome.

I don't see any specific mention of Main_Page in localsettings.php.

I removed all protections on Portal in localsettings.php, and set protections on Welcome "Protect" tab to "All Users".

Didn't help.

Also, still working on some NS's, not others. Eg., works on Draft, but not on Form.

My current declarations:

# PORTAL NAMESPACE 
define("NS_PORTAL", 3004);
$wgExtraNamespaces[NS_PORTAL] = "Portal";
define("NS_PORTAL_TALK", 3005);
$wgExtraNamespaces[NS_PORTAL_TALK] = "Portal_Talk"; 

# DRAFT NAMESPACE
define("NS_DRAFT", 3000); 
$wgExtraNamespaces[NS_DRAFT] = "Draft";
define("NS_DRAFT_TALK", 3001); 
$wgExtraNamespaces[NS_DRAFT_TALK] = "Draft_Talk"; 

# NAMESPACE PROTECTION
$wgNamespaceProtection[NS_PORTAL] = 
$wgNamespaceProtection[NS_FORM] = array( 'editprotected' );

# FLOW
wfLoadExtension( 'Flow' );
wfLoadExtension( 'Echo' );
$wgNamespaceContentModels[NS_PORTAL_TALK] = 'flow-board';
$wgNamespaceContentModels[NS_DRAFT_TALK] = 'flow-board';		
$wgNamespaceContentModels[NS_FORM_TALK] = 'flow-board';		

Any ideas, @Jdforrester (WMF)?

Johnywhy (talkcontribs)

Resolved, partially.

The Fix:

  1. Browse to the talk page that won't load Flow, Portal_Talk:Welcome
  2. Delete the Talk page using the Delete tab.
  3. Go to Portal:Welcome
  4. Click Discuss.
  5. You get Flow.

Apparently, even though the talk page appeared empty, something was remnant that was breaking Flow.

I re-validated my fix above, to put Flow declarations after protection, and it turns out that has no effect.

Still broke:

Now i'm getting Flow on all Talk pages EXCEPT Main and Form talk pages.

AM getting Flow on Category and Help talk pages.

I'm thinking this might be related to constants. My Flow declares are:

$wgNamespaceContentModels[NS_MAIN_TALK] = 'flow-board';		
$wgNamespaceContentModels[NS_FORM_TALK] = 'flow-board';		
$wgNamespaceContentModels[NS_HELP_TALK] = 'flow-board';		
$wgNamespaceContentModels[NS_CATEGORY_TALK] = 'flow-board';		

Maybe NS_HELP_TALK and NS_CATEGORY_TALK are defined in MW core, while NS_MAIN_TALK and NS_FORM_TALK are NOT defined in core.

Anyone know if that's the case?

Update, further fixed:

Yep. NS_MAIN_TALK is incorrect. It's just NS_TALK. Extension default namespaces#MediaWiki Core

Now the only namespace giving an issue is Page Forms' NS_FORM_TALK. The manual says Page Forms Talk NS is PF_NS_FORM_TALK. However that's not working. So instead of the constant, i tried the actual number: 107. That worked.

So far, it looks like i'm now getting Flow on all talk pages.

I'll mark this resolved after more testing.