Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this plugin error related to the Habari version? #1

Open
mmynsted opened this issue Nov 12, 2012 · 5 comments
Open

Is this plugin error related to the Habari version? #1

mmynsted opened this issue Nov 12, 2012 · 5 comments

Comments

@mmynsted
Copy link
Member

When attempting to activate the plugin I see only a blank page and plugin does not get activated.

SITE INFORMATION
Habari Version: 0.9-alpha
Habari API Version: 4956
Habari DB Version: 5101

The following is from the php_error.log
[12-Nov-2012 16:44:05] PHP Fatal error: Cannot override final method Plugin::info() in /habari/user/plugins/share/share.plugin.php on line 0
[12-Nov-2012 16:44:53] PHP Fatal error: Cannot override final method Plugin::info() in /habari/user/plugins/share/share.plugin.php on line 73
[12-Nov-2012 16:45:17] PHP Fatal error: Cannot override final method Plugin::info() in /habari/user/plugins/share/share.plugin.php on line 73
[12-Nov-2012 16:45:34] PHP Fatal error: Cannot override final method Plugin::info() in /habari/user/plugins/share/share.plugin.php on line 73
[12-Nov-2012 16:48:27] PHP Fatal error: Cannot override final method Plugin::info() in /habari/user/plugins/share/share.plugin.php on line 73
[12-Nov-2012 19:53:27] PHP Fatal error: Cannot override final method Plugin::info() in /habari/user/plugins/share/share.plugin.php on line 73

@chrismeller
Copy link
Member

It's a very old plugin that hasn't been updated since about 0.6 was released. You can try just removing the info() function in share.plugin.php.

@mmynsted
Copy link
Member Author

So I forked this to mmynsted/share, then removed the info() function. This permits the plugin to be activated.
I updated my theme to include the following in the head

<?php if ($request->display_entry && isset($post)) 
{
    $theme->show_share_metadata($post);
 } ?>

However the actual content for the provided share_metadata.php is never shown. The

$theme->show_share_metadata($post); 

method is called but nothing is displayed.

Now I never setup any facebook admins (was not sure what this was all about) from the configuration dialog, but it does not look required.

I was really just looking for the Open Graph Protocol parts of the share_metadata.php.
It looks like this plugin should be working...

@chrismeller
Copy link
Member

I'm not sure where you're putting this, but presumably it should be along with the post in your post.php template file (if you have one). Otherwise, the only thing I see missing is that you need to echo the contents: echo $theme->show_share_metadata( $post )

@mmynsted
Copy link
Member Author

oh. I just cut and pasted the code from the help in the share.plugin.xml.
That makes sense. I will try it.

@mmynsted
Copy link
Member Author

Adding the echo worked! The description is not populated but the other fields that I would expect to be populated are populated.

Looks like the description is populated via:

  public function theme_get_post_description($theme, $post) {                                                                                                                                                                                                             
                $content = explode('. ', strip_tags($post->content));                                                                                                                                                                                                           
                return $content[0] . '.';                                                                                                                                                                                                                                       
        }  

I am not sure exactly what that does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants