[Bug 59788] Invalid or virtual namespace -1 given.

2014-04-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

John F. Lewis johnflewi...@gmail.com changed:

   What|Removed |Added

   Priority|Unprioritized   |Normal
 CC||johnflewi...@gmail.com

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-10 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #13 from Daniel Kinzler daniel.kinz...@wikimedia.de ---
(In reply to comment #12)
 Note that technically there isn't a requirement for a valid title so much as
 that $context-getWikiPage() returns a WikiPage. You may be able to continue
 to pass the special page as the title if you manually set an appropriate
 WikiPage on the context.

That would be nice and easy if WikiPage was a nicely scoped interface. I don't
see a way though to return a WikiPage object for a page that doesn't have a
title yet. As it is now, you need a title to construct a WikiPage. We could use
the fake Q0 title there, and the special page's title in the context itself...
that might work, but it's even more black magick hackery :/

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-10 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #14 from Brad Jorsch bjor...@wikimedia.org ---
(In reply to comment #13)
 That would be nice and easy if WikiPage was a nicely scoped interface. I
 don't
 see a way though to return a WikiPage object for a page that doesn't have a
 title yet. As it is now, you need a title to construct a WikiPage. We could
 use
 the fake Q0 title there, and the special page's title in the context
 itself...
 that might work, but it's even more black magick hackery :/

MediaWiki::initializeArticle(), when given a title that cannot exist, calls
Article::newFromTitle()-getPage(), which does new WikiPage(). That apparently
works fine with special pages, even though WikiPage::factory() throws errors
when given a title that cannot exist.

Gerrit change 106530 just added this same logic to the API's action=parse, for
being able to call WikiPage's makeParserOptions() when given a special page
title.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-09 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #10 from Daniel Kinzler daniel.kinz...@wikimedia.de ---
How do you propose Wikidata/Wikibase can fix this? By providing a fake title?
There is not right title object of an actual page we can provide in this
situation. The title isn't know at that point.

The handling in core is largely fixed; legacy hooks are still called, but only
if used by an extension that isn't using the respective new hooks yet. 

My proposal is still: cache the ParserOutput in the WikitextContent object, and
see if that fixes the redundant parsing issue. And if not, find out why not,
and see if we can avoid re-creating Content objects.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-09 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

Daniel Kinzler daniel.kinz...@wikimedia.de changed:

   What|Removed |Added

   See Also||https://bugzilla.wikimedia.
   ||org/show_bug.cgi?id=57026

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-09 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #11 from Daniel Kinzler daniel.kinz...@wikimedia.de ---
Teh quick and dirty fix is to use Q0 as the title, instead of Special:NewItem.
That would create a broken/confusing link in the log entry, but should
otherwise work ok.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-09 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #12 from Brad Jorsch bjor...@wikimedia.org ---
Note that technically there isn't a requirement for a valid title so much as
that $context-getWikiPage() returns a WikiPage. You may be able to continue to
pass the special page as the title if you manually set an appropriate WikiPage
on the context.

BTW, what happens when you try to create a new entity via the API and it hits
the spam blacklist?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #5 from Aude aude.w...@gmail.com ---
I looked into how $title is used and it's used for log entries for blacklist
hits.

for example:

21:45, 7 January 2014 Aude (talk | contribs | block) caused a spam blacklist
hit on Special:NewItem by attempting to add http://j.mp.

In this case, I really think it telling me Special:NewItem makes a lot more
sense and makes things clear to the user than generating some Q (or P) id that
will never become a page since it will be blocked by blacklist.  (and then the
id is exhausted / used / wasted)  Maybe we could make a fake title like
Item:NewItem but that's icky.

I think spam blacklist should not use $title in a way that makes assumption the
title is associated with the content, at least for new items.  

When the edit is for an existing item or property, then we do have the title
and do set it for the context.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

Daniel Kinzler daniel.kinz...@wikimedia.de changed:

   What|Removed |Added

 CC||daniel.kinz...@wikimedia.de

--- Comment #6 from Daniel Kinzler daniel.kinz...@wikimedia.de ---
Using prepareContentForEdit() just to get a cached version of the parser output
seems evil... not to mention that prepareContentForEdit() is pretty bad of and
by itself and should be avoided. In any case, it is making assumptions that do
not hold here - in this case, the assumption that a page's title is well known
before the page has been created.

Also, as Aude said, at least for the log entry it makes much more sense to use
the special page's title.

For sharing ParserOutput between, I see two ways:

* use the ParserOutputCache directly
* make getParserOutput cache the last result it returned, and return it again
if the parameters are the same.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

Brad Jorsch bjor...@wikimedia.org changed:

   What|Removed |Added

 Blocks||57026

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #7 from Brad Jorsch bjor...@wikimedia.org ---
(In reply to comment #6)
 Using prepareContentForEdit() just to get a cached version of the parser
 output
 seems evil... not to mention that prepareContentForEdit() is pretty bad of
 and
 by itself and should be avoided.

Why is that, exactly? See bug 57026, BTW.

It seems to me that calling prepareContentForEdit() in an editing hook makes
complete sense.

 * use the ParserOutputCache directly

ParserOutputCache doesn't exist.

ParserCache works on the current version of an article, which isn't going to
help much when you don't have an article yet and you haven't yet saved the
text.

 * make getParserOutput cache the last result it returned, and return it again
 if the parameters are the same.

That doesn't help when not everything uses the same Content object. Or a
Content object at all.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #8 from Daniel Kinzler daniel.kinz...@wikimedia.de ---
(In reply to comment #7)
 It seems to me that calling prepareContentForEdit() in an editing hook makes
 complete sense.

Having an object that represents an edit in progress makes sense, yes. It could
have the old Content and Revision, the new Content, and perhaps the new Content
with PST applied. But it should be a wrapper object though that generates and
remembers parsed versions on demand, not up front. It should also have a well
defined interface, not just glued together public members. 

Much could however be already achieved by re-using and passing Content objects.

 ParserCache works on the current version of an article, which isn't going to
 help much when you don't have an article yet and you haven't yet saved the
 text.

True. A transient object representing the edit at hand makes more sense.

  * make getParserOutput cache the last result it returned, and return it 
  again
  if the parameters are the same.
 
 That doesn't help when not everything uses the same Content object. Or a
 Content object at all.

Everything handling content should use Content objects. Otherwise, how can you
handle content without knowing what it is?

And yes, ideally, it would always be the same Content object. There really is
no good reason to re-create instances. The Content object should be created
when loading from the DB, or when handling a post request - once. 

Trying to avoid re-creation of Content objects would be a good strategy to find
and eliminate redundant processing, and would allow for local caching e.g. of
the ParserOutput. Perhaps this would be the best approach to address the
performance issues described in bug 57026.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #9 from Brad Jorsch bjor...@wikimedia.org ---
So until that far-off day when you rewrite all the content handling in all of
MediaWiki and all extensions and remove all the old hooks, is Wikidata going to
fix this bug so we can re-close bug 57026?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

Sam Reed (reedy) s...@reedyboy.net changed:

   What|Removed |Added

 CC||aude.w...@gmail.com

--- Comment #1 from Sam Reed (reedy) s...@reedyboy.net ---
*** Bug 59797 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

Brad Jorsch bjor...@wikimedia.org changed:

   What|Removed |Added

 CC||bjor...@wikimedia.org

--- Comment #2 from Brad Jorsch bjor...@wikimedia.org ---
anomie aude, greg-g: Is this bug 59788? It looks like what's going on there
is that Wikibase has been passing a context for a special page to the
EditFilterMergedContent hook, and Gerrit change 101490 to SpamBlacklist made
the reasonable assumption that the context for that hook would be for a page
that's actually editable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #3 from Aude aude.w...@gmail.com ---
for new entities via the special page (and api?), EditEntity passes the context
of the special page (or who knows what) to SpamBlacklist.

Before I8c8b293, SpamBlacklist did:

$pout = $content-getParserOutput( $title );

with $title being Special:NewItem and $title never is used by
EntityContent::getParserOutput so there was no effect.

That might not be so nice to give special page context / title, but at this
point in EditEntity::attemptSave, the entity does not have an id yet. So we
don't really know what the actual title would be yet and might not make sense
to assign an id at that point.

Alternatively, perhaps $title is not really needed in SpamBlacklist for new
content?

SpamBlacklist needs title for existing pages, but $title seems less necessary
for new content. (it's used to make a log entry, afaik). 

For all content, a flag is also put on $title in case it's being checked more
than once.

if ( isset( $title-spamBlackListFiltered )  $title-spamBlackListFiltered
)...

Need to poke around to see what an appropriate solution to this is.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 59788] Invalid or virtual namespace -1 given.

2014-01-07 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=59788

--- Comment #4 from Aude aude.w...@gmail.com ---
https://gerrit.wikimedia.org/r/#/c/101490/ is the patch in question that causes
breakage to appear

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l