Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Print Topic Plugin Not Working
Avatar
Philip Treacy
Member
Free Members
sp_UserOfflineSmall Offline
Jul 13, 2016 - 11:44 pm

Hi,

I'm running :

  • SimplePress 5.6.7
  • Wordpress 4.5.3
  • Genesis 2.2.7
  • Epik 1.4 (Genesis Child Theme )

Have just installed and activated Print Topic 1.1.1 but can't print topics or posts.

After Print Topic is activated the printer icon for printing the topic does appear.

If I am looking at a topic e.g.

http://www.myonlinetraininghub.....sible-data

and I then click on the Print Topic icon it brings up this

Image Enlarger

 

If I then click on 'Open This Topic in Print View' the browser tries to load this URL

http://www.myonlinetraininghub.....opicprint/

and I see this on screen

Image Enlarger

 

Trying to print a post results in being sent to the same URL that does not exist.

No errors are logged in the SP Error Log.

Have deactivated the plugin for now.

Thanks

Phil

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 14, 2016 - 12:07 am

looks like its missing a trailing slash after the topic name...  can you verify on your wp settings - general admin panel what your site url and blog url are?  are they both missing a trailing slash?   thats not to say its wrong - if so, its likely our plugin is not properly handling sites that dont use the standard trailing slash on urls... if so, we can open a ticket and correct... but want to check first...

Avatar
Philip Treacy
Member
Free Members
sp_UserOfflineSmall Offline
Jul 14, 2016 - 12:19 am

Hi,

Site and blog URL have no trailing slash i.e. http://www.myonlinetraininghub.com

If I add the slash into the URL from the topic in my original post, I get a 404 error e.g.

http://www.myonlinetraininghub.....opicprint/

Thanks

Phil

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 14, 2016 - 3:51 am

Is the 404 because you have deactivated the plugin by any chance? 

The basic problem is that none of your urls have the final slash and they should have - at least  all of the forum urls should have. That's not to say that perhaps we should be checking for this but I have a hunch when we take a closer look at the code we will probably find we already are! And I will take a closer look this morning.

Meanwhile I am curious. Loading up a few of your pages at random I find that none have the trailing slash and this is not normal and strongly suggests that you have something active that is removing them. So can you tell us what other WordPress plugins you have active? Especially any that may be 'massaging' urls...?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 14, 2016 - 4:05 am

OK - let's step back. It is probably your WordPress permalink setting. Can you tell me what you have there please? I am betting there is no trailing slash. Is this by design?

And I will open a bug ticket and get this fixed up ASAP.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 14, 2016 - 5:07 am

And... finally...

It is a very simple fix if you feel like making a small edit to the code. So - just in case you do the file in question is:

/wp-content/sp-resources/forum-plugins/print-topic/ajax/sp-print-ajax-options.php

At line 22 in that file is this line of code:

$permalink = trailingslashit(sp_esc_str($url).'topicprint');

And that needs to be changed to:

$permalink = trailingslashit(sp_esc_str($url)).'topicprint';

You will see that the closing bracket simply needs to be moved

And of course - this plugin will be updated ASAP. And apologies for the issue - not using trailing slashes is very rare I think.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Philip Treacy
Member
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2016 - 8:59 pm

Thanks, editing that file fixed the issue.  Yes the site doesn't have trailing slashes.

Regards

Phil

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 17, 2016 - 9:04 pm

okay, thanks for the confirmation... is a parenthesis out of place... fix in place for next version update...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626