Hi Platonides
(sorry I posted from a wrong Email address, I try again with a proper subject line to get the thread line correct on http://news.gmane.org/gmane.science.linguistics.wikipedia.technical)
2013/1/15 Platonides Platonides@gmail.com:
I tried to get the content via getArticleID() ... $titleObj=Title::newFromText("Existing page"); $articleID=$titleObj->getArticleID(); Article::newFromID($articleID)->fetchContent(); etc. ... but it returns $articleID=0 although the page exits. With MW 1.18 this approach worked fine, but after upgrade to MW 1.20.2 it does not any more.
It should be working, and it works for me on 1.20.2 Can you provide more details on that $title->getArticleID(); which is not working?
On the http://offene-naturfuehrer.de/web/Spezial:MobileKeyV1 I want to generate a MobileKey for "Lamium (Deutschland)" (the page exists) and the PHP code wants to get the content of page "Unterlippe (Lamiaceae)" (the page exists too) but the PHP code above stops at the step retrieving the articleID. The strange thing is, when I want to generate a MobileKey for "Lamium (Deutschland)" and just print out (1) Title::newFromText("Unterlippe (Lamiaceae)") and (2) Title::newFromText("Lamium (Deutschland)") ... I get only an articleID for (2) not for (1)
WikiPage::factory ($titleObj) prints the same articleID data as Title::newFromText(...)
Andreas
--- printout of title object for page (1) "Unterlippe (Lamiaceae)"
Title Object ( [mTextform] => Unterlippe (Lamiaceae) [mUrlform] => Unterlippe_(Lamiaceae) [mDbkeyform] => Unterlippe_(Lamiaceae) [mUserCaseDBKey] => Unterlippe_(Lamiaceae) [mNamespace] => 0 [mInterwiki] => [mFragment] => [mArticleID] => 0 [mLatestID] => [mEstimateRevisions:Title:private] => [mRestrictions] => Array ( )
[mOldRestrictions] => [mCascadeRestriction] => [mCascadingRestrictions] => [mRestrictionsExpiry] => Array ( )
[mHasCascadingRestrictions] => [mCascadeSources] => [mRestrictionsLoaded] => [mPrefixedText] => [mTitleProtection] => [mDefaultNamespace] => 0 [mWatched] => [mLength] => -1 [mRedirect] => [mNotificationTimestamp] => Array ( )
[mHasSubpage] => )
--- printout of title object for page (2) "Lamium (Deutschland)" Title Object ( [mTextform] => Lamium (Deutschland) [mUrlform] => Lamium_(Deutschland) [mDbkeyform] => Lamium_(Deutschland) [mUserCaseDBKey] => Lamium_(Deutschland) [mNamespace] => 0 [mInterwiki] => [mFragment] => [mArticleID] => 36 [mLatestID] => [mEstimateRevisions:Title:private] => [mRestrictions] => Array ( )
[mOldRestrictions] => [mCascadeRestriction] => [mCascadingRestrictions] => [mRestrictionsExpiry] => Array ( )
[mHasCascadingRestrictions] => [mCascadeSources] => [mRestrictionsLoaded] => [mPrefixedText] => [mTitleProtection] => [mDefaultNamespace] => 0 [mWatched] => [mLength] => -1 [mRedirect] => [mNotificationTimestamp] => Array ( )
[mHasSubpage] => )