Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: URL in Comment Notification emails contains “en”

Status Resolved
Add-on / Version Publisher Lite 1.1.3
Severity Trivial
EE Version 2.7.3

Stephen Tidmore

Jan 13, 2014

I’m not sure if this has anything to do with Publisher Lite or not, but I wanted to ask just to make sure I can rule it out.

We have comment notification emails going out each time a comment is submitted on a site. The URL to the blog post that is included in the comment notification emails follow this pattern:  http://www.website.com/en/blog/article/title-of-entry

I can’t figure out where the “en” is coming from in that link, since this isn’t a multi-lingual website. Is there any chance that is being inserted by Publisher Lite? If so, any idea how I can remove it?

#1

BoldMinded (Brian)

Hi, Stephen. Yeah, Publisher is probably inadvertently putting that in there. I’ll try to track it down this week and get you a new build.

#2

Stephen

Thanks Brian. Did you have a chance to look into this last week?

#3

BoldMinded (Brian)

I did not, sorry. I’ll try to get to it this weekend.

#4

BoldMinded (Brian)

Stephen, what does your notification template contents look like?

#5

Stephen

Hey Brian,

We’re just using the default template. Here’s the code:

You have just received a comment for the following channel:
{channel_name}

The title of the entry is:
{entry_title}

Located at: 
{comment_url}

Posted by: {name}
Email: {email}
URL: {url}
Location: {location}

{comment}
#6

BoldMinded (Brian)

Oh that template. I thought you meant Publisher’s notification templates. I was looking in the wrong place. I’ll give it a look tonight and hopefully have a fix for you tomorrow.

#7

BoldMinded (Brian)

Open the Publisher_session.php file and go to line 463 or so inside of set_url_prefix() and change this:

if ( !ee()->publisher_setting->url_prefix())

to this:

if ( !ee()->publisher_setting->url_prefix() || PUBLISHER_LITE)

#8

BoldMinded (Brian)

Stephen, ignore that last comment. I did some testing and I think this is the fix you’re looking for.

diff --git a/third_party/publisher/libraries/Publisher/helpers/Publisher_helper_url.php b/third_party/publisher/libraries/Publisher/helpers/Publisher_helper_url.php
index 267fd88d784ee64e1aa2172adfc2f447c4838949..ce8ece748879cf240292ebc8c6767a26ba8f00d7 100644
--- a/third_party/publisher/libraries/Publisher/helpers/Publisher_helper_url.php
+++ b/third_party/publisher/libraries/Publisher/helpers/Publisher_helper_url.php
@@ -519,6 +519,11 @@ class Publisher_helper_url
      */
     public function should_add_prefix($lang_id_to = NULL)
     {
+        if (PUBLISHER_LITE)
+        {
+            return FALSE;
+        }
+        
         $add_prefix = TRUE;
         $lang_id = $lang_id_to ? (int) $lang_id_to : (int) ee()->publisher_lib->lang_id;
#9

BoldMinded (Brian)

Stephen, did this fix the issue?

#10

BoldMinded (Brian)

I’m going to mark this as resolved with the code patch above. I replicated the issue, and the patch fixed it.

Login to reply