By Stephen on Tuesday, 29 September 2015
Posted in Technical Issues
Replies 3
Likes 0
Views 1.4K
Votes 0
After some effort I think I have found a partial solution to using News Pro with Easyblog5.
I have had many issues with NewsPro not picking up the image from the blog. This is ONLY AN ISSUE when the image is the Cover Image or the Blog image. If the image is embedded as the first image in the blog text, all is good.
I first had problems when I upgraded even posted a problem, but I thought the issue was solved however it was just masked because all works well if the image is the first one inside the blog text.
The fix can be done by hacking News Pro and the code in t/modules/mod_news_pro_gk5/tmpl/com_easyblog/view.php around line 21 where the code checks to see if there is a path in the image field of the easyblog_posts table. If there is a path it means there is a cover image.
For me there are two problems.
Case 1
The blogs were imported from a previous version of Eastblog and I did their upgrade. Even with the latest version of NewsPro I did not get cover/blog images. If I looked in the path of the image file stored in the easyblog posts table it was of the form user:ID/imagename.jpg, in my case user:991/imagename.jpg would be typical.
I see the code in the current NewsPro looks for the string post: and removes it with a string replace on about line 26. I changed it to replace user: and that helped clean up my path.
Case 2
Same issue above but my images were stored in the folder images/easyblog_image/ not the images/easyblog_articles/ which is the current easyblog default. So I also had to change the path that is added on line 28 to be the same as mine and what I had set in the easyblog media settings.
Case 3
This was a big deal to find. If the easyblog installation is default, the media settings have the shared folder set to images/easyblog_shared/ if you use this option and allow users to store media in it and they post that media as the cover image, again NewsPro does not pick up the images. The problem is that the path easyblog chooses to put in their table has the form shared/imagename.jpg and somehow NewsPro is supposed to change to replacing shared/ with easyblog_shared/. At first I was about to hack the view.php file to test for the new case and replace shared/ with easyblog_shared. But I found a simpler fix.
I moved all my images from images/easyblog_shared/ to images/easyblog_articles/shared and changed the shared directory path in the easyblog media settings to match. Now my images show up and the NewPro code only needed the post/user hack. Now if you have a lot of shared media files embedded in the blog text this fix will break them, but for me I was in the upgrade test phase so not an issue.

Future?
Well somehow I think there is more to this, easyblog probably has more cases for file paths that get put in their blog table, I do not think NewPro coders made up the post: case. But for now this fix is stable.
I do think easyblog coders could just put the real image path in their table. Would help us all.
I also worry that it seems easyblog puts the full site path into the blog text when you put a shared image into the blog text. This will cause me all sorts of problems whenever I move a site.
Hi Stephen,

Thank you for your workaround suggestions of this module. May I know what the initial issue with this module on your site? Is it the image is not fetching correctly? I've checked the module and it seems like there are lots of code modifications in place hence I am not able to identified the exact issue here.

By the way I believe it is best for you to forward this issue to this module developer itself since they know best with their own components.
·
Tuesday, 29 September 2015 13:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for your answer but do not think that your coders are completely without issue in this. Of course I have sent it to the developer who probably will wonder like I do why you coded things in such a way.
The site I am using is a test site and I have not asked you to look at it. But the tone of your reply suggest you do not feel this issue is relevant to you.
I have spent a lot of time trying to make your upgrade work and so far I feel this latest version was a bold move by you guys but not ready for prime time. I am backing out of the upgraded today for the third time unable to make it work reliably.
You upgrade script from the previous version is just not capable of working for me because of the range of options I initially used. You gave no warning of introducing a completely new concept for many things and reset many options when you upgrade a previous version. I can live with many of them, my work around for you moving where you store images and not working with NewsPro, but the overall problems with breadcrumbs remain, despite your pervious "hack" of a core file. And using the site absolute URL for images from the shared folder added to the blog text seems to be a major problem waiting to happen. If I move a site then all the internal images links break. Why would you code it like that? I guess I will be writing more support requests when I try your upgrade again in a few more weeks when I hope it will be a bit more mature.
·
Tuesday, 29 September 2015 21:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Stephen,

Firstly, I do apologize if my colleague sounded rude to you but to be honest, I don't think it was ever his intention. If he did sounded rude or gives you the impression that we do not care, I would like to apologize on his behalf.

That being said, it was always our intention on getting 3rd party developers to continue supporting us. In fact, I even provided a patch / fix for News Show Pro at http://stackideas.com/forums/fix-for-mod_news_pro_gk5 and still hadn't received any reply from Gavick yet


Thanks for understanding and I appreciate your input on this matter very much. If you need any assistance at all, let me know.
·
Tuesday, 29 September 2015 23:36
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post