[CDB] Smartfeed 3.0.4

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
MarkDHamill
Registered User
Posts: 3855
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

[RC3] Smartfeed 3.0.4 released

Post by MarkDHamill » Mon Apr 04, 2016 1:24 am

Okay, Release Candidate 3, version 3.0.4 of Smartfeed is available for testing and has been submitted for extension team review. Some things have changed but no new functionality so grab the latest version from the GitHub:

https://github.com/MarkDHamill/smartfeed

Alternatively, you can download the zip file from my website.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

Sanborn
Registered User
Posts: 55
Joined: Mon Mar 16, 2015 7:01 pm

Re: [RC2] Smartfeed 3.0.3

Post by Sanborn » Wed Apr 13, 2016 7:23 pm

Hi,

Great work! :)
I installed version 3.0.3 and it worked perfect.
Now I installed version 3.0.4, but I can't access the configuration page anymore.
http://www.mysite.com/app.php/smartfeed/smartfeed gives me:

No route found for "GET /smartfeed/smartfeed"

Any idea how to fix that?

Also noticed in your zip file the constants.php still refers to 3.0.3 (it's correct when I download the zip from GitHub).

And one last thing, you have a typo in languages\en\ui.php
The key SMARTFEED_SELECT_FORUMS_EXPLAIN has "... If looged in then all..." which should be "logged" :)

Sanborn
Registered User
Posts: 55
Joined: Mon Mar 16, 2015 7:01 pm

Re: [RC2] Smartfeed 3.0.3

Post by Sanborn » Wed Apr 13, 2016 7:30 pm

Sanborn wrote:Hi,
Now I installed version 3.0.4, but I can't access the configuration page anymore.
http://www.mysite.com/app.php/smartfeed/smartfeed gives me:

No route found for "GET /smartfeed/smartfeed"

Any idea how to fix that?
Found it, it's now this URL:
http://www.mysite.com/app.php/smartfeed/ui

User avatar
MarkDHamill
Registered User
Posts: 3855
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC2] Smartfeed 3.0.3

Post by MarkDHamill » Wed Apr 13, 2016 9:13 pm

Sorry, I missed this. Yes, the URLs changed because the extension team wanted me to put the user interface and the feed generation into separate programs.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

michael.s
Registered User
Posts: 13
Joined: Sun Jan 24, 2016 9:40 am

Re: [RC2] Smartfeed 3.0.3

Post by michael.s » Fri Apr 15, 2016 4:22 pm

Hi Mark,

I installed 3.0.4 on my phpBB 3.1.8 which I just wanted to release into productivity. I noticed that on the normal forum list page there is "SMARTFEED_PAGE" shown in the menu bar where it should just show "Smartfeed". If I click on it I get to the smartfeed page - now, in the menu bar, "Smartfeed" is shown, no more "SMARTFEED_PAGE". Tried this with my own style as well as the standard prosilver style. Both the same. Do you have any idea?

User avatar
MarkDHamill
Registered User
Posts: 3855
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC2] Smartfeed 3.0.3

Post by MarkDHamill » Fri Apr 15, 2016 9:07 pm

Yes, I sent these bugs changes to GitHub. You can see a list of tweaks here:

https://github.com/MarkDHamill/smartfeed/commits/master
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

michael.s
Registered User
Posts: 13
Joined: Sun Jan 24, 2016 9:40 am

Re: [RC2] Smartfeed 3.0.3

Post by michael.s » Sat Apr 16, 2016 4:46 am

Great, thanks for that. I downloaded the latest package from github.

Another issue I found is: When I select more than 14 days time limit for my feed (which presently is 68 posts in my forum) and HTML feed styling, I get an empty feed. 14 days or less is working fine. If I choose compact or basic as feed styling it also works for 30 days.

I tried to find out if there is a post, between 14 and 30 days old, that might have characters in it which could interfere with html style, but had to give up since there were too many posts overall and nothing obvious noticeable. Anyway, you might want to check if that is a possible reason.

michael.s
Registered User
Posts: 13
Joined: Sun Jan 24, 2016 9:40 am

Re: [RC2] Smartfeed 3.0.3

Post by michael.s » Sat Apr 16, 2016 6:01 am

Addition: Without being logged in, clicking the Smartfeed-Link leads to a page saying "SMARTFEED_NO_FORUMS_AVAILABLE".

User avatar
MarkDHamill
Registered User
Posts: 3855
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC2] Smartfeed 3.0.3

Post by MarkDHamill » Sat Apr 16, 2016 1:53 pm

michael.s wrote:Addition: Without being logged in, clicking the Smartfeed-Link leads to a page saying "SMARTFEED_NO_FORUMS_AVAILABLE".
If no forum is accessible without being registered, you will get this message. The problem is the language variable is in the wrong place. I had to move a language variable from language/en/feed.php to language/en/common.php. These have been published to GitHub. Thanks for discovering this bug.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
MarkDHamill
Registered User
Posts: 3855
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC2] Smartfeed 3.0.3

Post by MarkDHamill » Sat Apr 16, 2016 2:01 pm

michael.s wrote:Great, thanks for that. I downloaded the latest package from github.

Another issue I found is: When I select more than 14 days time limit for my feed (which presently is 68 posts in my forum) and HTML feed styling, I get an empty feed. 14 days or less is working fine. If I choose compact or basic as feed styling it also works for 30 days.

I tried to find out if there is a post, between 14 and 30 days old, that might have characters in it which could interfere with html style, but had to give up since there were too many posts overall and nothing obvious noticeable. Anyway, you might want to check if that is a possible reason.
Were other feed filters applied? I don't see this behavior on my test board.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

michael.s
Registered User
Posts: 13
Joined: Sun Jan 24, 2016 9:40 am

Re: [RC2] Smartfeed 3.0.3

Post by michael.s » Tue Apr 19, 2016 7:11 pm

I did further testing and after some tries I found the problem to be consisting of two separate issues.

#1: When I configure Smartfeed to always include one forum, the feed obviously includes all forums, even if I deselect all other forums when generating the feed. This happens no matter which forum I force to be included on the admin panel.

#2: I get an empty feed if a post with file attachment is included in the selected time range and HTML is selected as feed styling.

Due to #1, it was a bit hard to find out what #2 was about, because even if I deselected all forums (except the one that was configured to be always included) Smartfeed included the forum with the post with attachment - and issue #2 caused the feed to be empty.

However, now I can reproduce those two reliably by setting parameters/fliters as described above.

User avatar
MarkDHamill
Registered User
Posts: 3855
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC2] Smartfeed 3.0.3

Post by MarkDHamill » Thu Apr 21, 2016 12:08 am

In my test I selected only forum_id = 2 which includes a topic "Long Topic". I do however have two forums that are required, with forum_ids 6 and 7. I went back 90 days which would also include a post in forum_id = 3 that is in the time range if I selected it ("Test topic"), which I did not. The resulting SQL correctly does not include forum_id = 3:

Code: Select all

SELECT f.*, t.*, p.*, u.*, tt.mark_time AS topic_mark_time, ft.mark_time AS forum_mark_time FROM (phpbb_forums f CROSS JOIN phpbb_topics t CROSS JOIN phpbb_posts p CROSS JOIN phpbb_users u) LEFT JOIN phpbb_topics_track tt ON (t.topic_id = tt.topic_id AND tt.user_id = u.user_id) LEFT JOIN phpbb_forums_track ft ON (f.forum_id = ft.forum_id AND ft.user_id = u.user_id) WHERE f.forum_id = t.forum_id AND t.topic_id = p.topic_id AND p.poster_id = u.user_id AND p.post_time > 1453420152 AND p.forum_id IN (2, '6', '7') AND p.post_visibility = 1 ORDER BY t.topic_last_post_time DESC, p.post_time 
In the Smartfeed URL you should see parameters like &f=1&f=2, one for each forum selected, in this case only forum_ids 1 and 2 should be in the feed, unless there are required forums. The absence of a "f" parameter means all forums that the user has read access to are selected instead.

An attachment shows up in my feed as well.

So I am at a loss to explain your behavior. It might be something about needing a larger test bed. Perhaps I am missing a needed join somewhere but I don't think so.

Line 885 of feed.php should be:

Code: Select all

			$sql = $this->db->sql_build_query('SELECT', $sql_array);
Add the following code. What do you see?

Code: Select all

			echo $sql;
			exit;
What shows up when you use a tool like phpMyAdmin to see what rows are retrieved when you copy and paste in the SQL that should get executed?
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

michael.s
Registered User
Posts: 13
Joined: Sun Jan 24, 2016 9:40 am

Re: [RC2] Smartfeed 3.0.3

Post by michael.s » Thu Apr 21, 2016 7:29 pm

Ok, I start with the selection of forums:

The forum id I force to be included on the admin panel is #17. Now, if I create a feed and select all forums (which is the default), there is no "f=" in the URL, as you wrote. All forums are included in the feed then.

If I deselect all forums except #17 (checkbox checked and greyed out), I find the parameter "&forum=-1" in the URL, but there is no "f=". The feed then, as I described in my previous post, includes all forums. If I select only one forum, the f= parameter is included in the URL but only points to the selected forum; #17 is not included in this case.

The forums are not continuously numbered and there are gaps (9,10,28,11,51 and so on). This might be different from a freshly installed test board.

Regarding the SQL query: The post with attachment that seems to break the HTML feed is a PDF with a size around 250 kBytes. The filename includes several underscores and is 54 characters long. Presently, I have no testing environment available that is up-to-date, so it will take quite a few days before I have time to update my test installation and try to modify the code with the test output as you suggested. I'll get back here as soon as I have a result.

User avatar
MarkDHamill
Registered User
Posts: 3855
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC2] Smartfeed 3.0.3

Post by MarkDHamill » Thu Apr 21, 2016 9:00 pm

Thank you for your testing. I think I see the issue. Change line 105 of ext/phpbbservices/smartfeed/styles/prosilver/template/event/overall_header_head_append.html from:

Code: Select all

		forumString = forumString + "&forum=-1"; // -1 means that no forums were selected but there are required forums
to:

Code: Select all

		forumString = forumString + "&f=-1"; // -1 means that no forums were selected but there are required forums
Purge the cache afterward.

This is definitely a bug but an edge case. I'm not surprised it was not discovered and glad you discovered it. This is a result of me shortening the URL moving Smartfeed from a mod to an extension and I missed this code change somehow.

&f=-1 is a way of flagging that you selected no forums but there are required forums.

I don't know what you are using to read the newsfeed, but my suspicion is that the second problem is related to your newsreader somehow garbling or changing the URL for the attachment, or that its interface for handling PDF is substandard, bounded by a memory limitation. Smartfeed doesn't care what the URL extension is or how big it is. It should only create valid RSS or Atom XML markup. Using a different newsreader might make the issue go away. In my testing I use Firefox and when I hit the Test button in the Smartfeed user interface, Firefox brings it up and renders it in a tab. So far I have noted no issues with attachments rendering in Firefox. Regardless, the XML should be valid for the feed type and if checked with a RSS or Atom validator should show a clean and correct feed.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

michael.s
Registered User
Posts: 13
Joined: Sun Jan 24, 2016 9:40 am

Re: [RC2] Smartfeed 3.0.3

Post by michael.s » Fri Apr 22, 2016 1:30 pm

Thank you for the quick reply. I applied the patch, so the selection of forums is now working smoothly.

To find out about the other issue I tested my problematic feed URL with the w3c feed validator (https://validator.w3.org/feed/). The result was "Server returned HTTP Error 500: Internal Server Error". Since my webspace provider does not give me access to the server logs I copied my production environment into my local test environment and generated the same feed again. This is the result of loading the feed URL in Firefox:

Fatal error: Call to undefined function phpbbservices\smartfeed\controller\get_default_style() in \phpBB3\ext\phpbbservices\smartfeed\controller\feed.php on line 1458

I looked into feed.php - it obviously uses get_default_style() to build the path to the attachment icon. Note that I am using an own style (as default style) which is a substyle of prosilver - so the icon image is only present in /styles/prosilver/theme/images/icon_topic_attach.gif but not in /styles/myownstyle/theme/images/icon_topic_attach.gif. I tried hard-coding the path to the prosilver icon into that line in feed.php and now the feed shows up without any error.

Locked

Return to “Extensions in Development”