Extension talk:OpenGraphMeta

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Contents

Thread titleRepliesLast modified
Incorrect Namespace114:20, 20 April 2012
Suggestion: Change home page default title101:03, 14 February 2012
Bug or User Error?110:41, 10 January 2012
Mediawiki version required?210:40, 10 January 2012

Incorrect Namespace

Installed the extension but when I tried it on a page I changed this code:

((File:Prague.jpg|right|border|thumb|400px|Prague Old Town))

to this:

((File:{{#setmainimage:Prague.jpg}}|right|border|thumb|400px|Prague Old Town))

(Square brackets changed to round brackets for clarity.)

This throws an error:

RepoGroup::findFile recieved an Title object with incorrect namespace Backtrace:

  1. 0 /home/XXX/public_html/includes/GlobalFunctions.php(3235): RepoGroup->findFile(Object(Title), Array)
  2. 1 /home/XXX/public_html/extensions/OpenGraphMeta/OpenGraphMeta.php(58): wfFindFile(Object(Title))
  3. 2 [internal function]: efSetMainImagePH(Object(OutputPage), Object(ParserOutput), Array)
  4. 3 /home/XXX/public_html/includes/OutputPage.php(1190): call_user_func('efSetMainImageP...', Object(OutputPage), Object(ParserOutput), Array)
  5. 4 /home/XXX/public_html/includes/OutputPage.php(1203): OutputPage->addParserOutputNoText(Object(ParserOutput))
  6. 5 /home/XXX/public_html/includes/Article.php(4392): OutputPage->addParserOutput(Object(ParserOutput))
  7. 6 /home/XXX/public_html/includes/Article.php(1490): Article->outputWikiText('[[File:{{#setma...', true, Object(ParserOptions))
  8. 7 /home/XXX/public_html/includes/Article.php(4636): Article->doViewParse()
  9. 8 /home/XXX/public_html/includes/PoolCounter.php(151): PoolWorkArticleView->doWork()
  10. 9 /home/XXX/public_html/includes/Article.php(1011): PoolCounterWork->execute()
  11. 10 /home/XXX/public_html/includes/Wiki.php(462): Article->view()
  12. 11 /home/XXX/public_html/includes/Wiki.php(69): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
  13. 12 /home/XXX/public_html/index.php(114): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
  14. 13 {main}

Can anyone help?

PS Using MediaWiki 1.17.0 PHP 5.2.12 (apache) MySQL 5.0.95-community

79.35.205.23314:53, 18 April 2012

As an update, I upgraded to MW 1.18 and used the 1.18 version of the extension but the problem remains...

79.35.205.23314:20, 20 April 2012
 

Suggestion: Change home page default title

Hello,

This opengraph extension gives the homepage of the wiki the title 'Main Page'. However it might be better to use the site name for this one particular page. It looks better on Facebook this way, and as 'Main page' is a default string, using the site name instead would actually make more sense (to me).

Kevin, Enideo

85.151.118.19011:41, 9 February 2012

Implemented that in r111438.

Daniel Friesen (Dantman)01:03, 14 February 2012
 

Bug or User Error?

This didn't seem to output the correct format for the OG meta tags due to the addMeta function called with the BeforePageDisplay hook. Could be my fault. For example, I am getting <meta name="property:og:type" content="article" /> when it should be <meta property="og:type" content="article"/>. Unless there's something I'm missing, addMeta will only return <meta name="$value1" content="$value2"/> formatted meta tags.

I am on MediaWiki 1.18.0, PHP 5.2.17, and MySQL 5.1.56--maybe the function addMeta has changed in the latest update? I corrected it by using the hook OutputPageBeforeHTML and the function addHeadItem to output:

foreach( $meta as $property => $value ) {
        if ( $value ){
                $out->addHeadItem( "OGMeta$i", '<meta property="'.$property.'" content="'.$value.'"/>'.PHP_EOL );
                $i++;
        }       

It seems to work. Thoughts?

Lost Student 09:07, 10 January 2012 (UTC)10:41, 10 January 2012

Try the trunk or 1.17 version of the extension. The 1.18 version seams to contain a change made after the 1.17 branch but was reverted later on.

Daniel Friesen (Dantman) 09:49, 10 January 2012 (UTC)10:41, 10 January 2012
 

Mediawiki version required?

Hi all, I have just tested this extension on a 1.15.4 MediaWiki installation and I had an error reporting:

Call to undefined method OutputPage::getTitle() in C:\server\xampplite\htdocs\wiki\extensions\OpenGraphMeta\OpenGraphMeta.php on line 65

Installation data:

  • MW 1.15.4
  • PHP 5.3.0
  • MySQL 5.1.41

Extensions installed:

  • MultipleUpload 1.0
  • Cite r.37577
  • DSADate 1.0
  • DynamicPageList2 1.7.4
  • ImageMap r.35980
  • ImageSizeInfoFunctions 1.0.1
  • MultipleUploadToolboxItem 0.1
  • ParserFunctins 1.1.1
  • PropertyTable2 1.2.1
  • StringFunctions 2.0.1
  • SyntaxHighlight
  • GoogleTranslator 0.1
  • NewUserEmailNotification 1.5.1

Moreover, inspecting the code, it seems that the extension Description2 is required for properly description tag be evaluated. Is my assumption correct? TIA

--GB 11:18, 31 July 2011 (UTC)10:39, 10 January 2012

Yes, Description2 has the parsing code to extract a description from the page so OpenGraphMeta uses it instead of duplicating code.

—The preceding unsigned comment was added by an unknown user on a unknown date.10:40, 10 January 2012
 

OutputPage::getTitle was added in 1.16; 1.15 is not a supported MediaWiki version anymore, it's no longer receiving security updates and some security holes have been fixed in later versions of MediaWiki. So I see no reason to add 1.15 compat.

Dantman 11:53, 31 July 2011 (UTC)10:40, 10 January 2012
 
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox