Share plugin wipes Related

Creating and modifying plugins.
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Share plugin wipes Related

Post by Noelb »

Enabling the social media share plugin, disables Related articles plugin, mark share plugin inactive and related links returns, I've tried re organising them early, later before after each other and seems to make no difference
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Share plugin wipes Related

Post by onli »

Does it disable the plugin in the plugin menu or does it stop the plugin from working, i.e. there are no related article anymore?
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Re: Share plugin wipes Related

Post by Noelb »

now the share plgin is gone , kind of beyond a joke, is there a replacement for this serendipity_event_social plugin?

its gone altogether, if I enable show on overview it works everywhere, disable on overview, it used to show on full article, now it doesnt unless I enable on overview, checked different browsers, usaed inspec, its just nothere. tried re-ordering in to top of list and bottom and middle, nope *sigh*

this is the most touchy sensitive plugin ever, so can anyone recommend a replacement or there a new one in git dev?
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Share plugin wipes Related

Post by onli »

It can't be gone :/ https://github.com/s9y/additional_plugi ... social.php literally has only one condition where it might not show the entry, and that's the overview setting you discovered already.

My only idea is that it collides with the cache, either the cache from serendipity's settings or with the one from the entryproperties-plugin. But both is unlikely.

I'm not aware of there being an alternative to this plugin. The predecessor was serendipity_event_findmore, but that was abandoned.
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Re: Share plugin wipes Related

Post by Noelb »

OK, well something is preventing it, with my blog, it would look wrong to enable it full time, and I dont see why someone would share without reading the full article, so enabling on overview, is not an option IMHO.

If it helps I actually set disabled all plugins, except this one, saved, checked even using an unopened browser on a PC I rarely use (since its windows10), still no go, added jquery back - as first plugin, since I think I read somewhere thats best place for that one, and still nothing, re added all other plugins, still nothing, so maybe this cache you speak of is the cause, is there a way I can check that?
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Share plugin wipes Related

Post by onli »

You can try it with a deactivated cache. It can be disabled at "Configuration -> General Settings -> Activate Cache", the option at the bottom.

It's also possible that the code produces an error and then outputs nothing. Did you have a look into the webserver/php log?
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Re: Share plugin wipes Related

Post by Noelb »

onli wrote: Thu Jan 20, 2022 5:34 pm You can try it with a deactivated cache. It can be disabled at "Configuration -> General Settings -> Activate Cache", the option at the bottom.

It's also possible that the code produces an error and then outputs nothing. Did you have a look into the webserver/php log?

OK, so cache was already No. I've tried the template_c/logs with error and debug neither log anything, both files 0 bytes.

Apaches log shows only one error, and that was from 2 days ago, unrelated

Wed Jan 19 13:24:17.364733 2022] [php7:error] [pid 12179:tid 140008920921664] [client 216.131.114.144:51022] PHP Fatal error: Uncaught Net_DNS2_Exception: timeout on read select() in /var/www/blog/bundled-libs/Net/DNS2.php:1091\nStack trace:\n#0 /var/www/blog/bundled-libs/Net/DNS2.php(1393): Net_DNS2->generateError()\n#1 /var/www/blog/bundled-libs/Net/DNS2.php(972): Net_DNS2->sendUDPRequest()\n#2
..snip..
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Re: Share plugin wipes Related

Post by Noelb »

okkkkkkkkk, I've got somewhere, its an update of the social plugin.

A plugins update was run on Jan 1, however I grabbed a backup of the social plugin directory only just now, and it's working again. Backup was from Dec '21, and the code is dated April '21

Something between propbag->add('version', '0.14.4');
and whatever the existing code is, breaks current stable v2.3.5 , or at least in my configuration it does.
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Re: Share plugin wipes Related

Post by Noelb »

- if ($serendipity['view'] != 'entry') {
+ if ($serendipity['view'] ?? '' != 'entry') {
- $meta_description = strip_tags($entry['properties']['meta_description']);
+ $meta_description = strip_tags($entry['properties']['meta_description'] ?? '');


0.14.5
+ * Avoid PHP 8 warning warning about missing view key
+ in entry preview
+ * Avoid PHP 8 warning about missing metadesc key in
+ entries without such a description
+


So this php8 thing breaks php7 thing :)
erAck
Regular
Posts: 236
Joined: Mon Feb 16, 2015 1:20 am

Re: Share plugin wipes Related

Post by erAck »

No. But the expression does not take operator precedence (lower than !=) and right-associativity of the ?? null coalescing operator into account.
$serendipity['view'] ?? '' != 'entry'
effectively is
$serendipity['view'] ?? ('' != 'entry')
but wanted is
($serendipity['view'] ?? '') != 'entry'
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Share plugin wipes Related

Post by onli »

Ah, that's a good find! I will add an update to Spartacus.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Share plugin wipes Related

Post by onli »

I did push an update: 0.14.6 adds the () like erAck described.

But I could not test this, since for me it worked in both configurations - and actually, I'm surprised by the () being necessary here. Have a look whether it works please, if not we can try an alternative fix.
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Re: Share plugin wipes Related

Post by Noelb »

No problem, will try update this afternoon (I still have the backup in /tmp if it fails either way).
I'll report back soon
Noelb
Regular
Posts: 75
Joined: Wed Jul 27, 2011 7:16 am

Re: Share plugin wipes Related

Post by Noelb »

Thanks, all good with update :)
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Share plugin wipes Related

Post by onli »

Thanks for the report :)
Post Reply