News module - link to detail of the news is showing summary instead of detail Topic is solved
News module - link to detail of the news is showing summary instead of detail
Hi, I have created two templates - [glow]'News::Summary'[/glow] and [glow]'News::Detail'[/glow]. Both are set as default. Then in the page I am calling only plain [glow]{news}[/glow] to render the list of news. It is correctly render news using [glow]'News::Summary'[/glow]. Inside of the template I have [glow]'{$entry->morelink}'[/glow], but when the user clicks on this link, it correctly redirects to [glow]'mact=News,cntnt01,detail,0&cntnt01articleid=5&cntnt01origid=33&cntnt01detailtemplate=blog_detail&cntnt01returnid=33'[/glow], but summary template is rendered instead of detail. In short, the detail is not rendered at all and the list of news is rendered always, no matter if summary page is required or detail of the news is required. What am I doing wrong? What am I missing? Thank you very much.
Re: News module - link to detail of the news is showing summary instead of detail
I can't really think of a way that would happen. Without investigating I'm struggling to even come up with a situation that could make this happen even intentionally. You may want to try a clean install on a test site using default templates (page and news) and see if you can recreate it. If it works with everything default then slowly work back in your custom templates to see where it breaks.
If you can recreate it using default templates on a clean install, you may want to file a bug report with steps to reproduce.
If you can recreate it using default templates on a clean install, you may want to file a bug report with steps to reproduce.
Not getting the answer you need? CMSMS support options
Re: News module - link to detail of the news is showing summary instead of detail
Thank you very much DIGI3, I digged a little bit and I got some details here. In the file "lib/module.functions.php" I put some echos and when I added after the line 85 "$mactinline = (isset($ary[3]) && $ary[3] == 1?true:false);" following:
I got:
So I tried to change the url from original
to
-> I replaced cntnt01 with m53286 and I put inline to 1 instead of 0 and it worked correctly - the article was displayed as I expected. Even when I put away query param detailtemplate=blog_detail it worked. So it is correctly working with
.
So the question is why $checkid is different to $id? And if the links are really meant to not be inline, I mean if really should be $mactinline = 0, why $params does not contain 'action' key at all? And IMO it should contain correct 'idprefix', which is also not in $params. So $id is generated via md5 call over $params, which is in my case:
Still not any idea what am I doing wrong?
Code: Select all
if ($modulename == 'News') {
echo $mactmodulename . '<br />';
echo $checkid . '<br />';
echo $id . '<br />';
echo $mactaction . '<br />';
echo ($mactinline ? 'True' : 'False') . '<br />';
exit();
}
Code: Select all
News
cntnt01
m53286
detail
False
Code: Select all
mact=News,cntnt01,detail,0&cntnt01articleid=5&cntnt01origid=33&cntnt01detailtemplate=blog_detail&cntnt01returnid=33
Code: Select all
mact=News,m53286,detail,1&m53286articleid=5&m53286origid=33&m53286detailtemplate=blog_detail&m53286returnid=33
Code: Select all
mact=News,m53286,detail,1&m53286articleid=5&m53286returnid=33
So the question is why $checkid is different to $id? And if the links are really meant to not be inline, I mean if really should be $mactinline = 0, why $params does not contain 'action' key at all? And IMO it should contain correct 'idprefix', which is also not in $params. So $id is generated via md5 call over $params, which is in my case:
Code: Select all
array(1) {
["module"]=>
string(4) "News"
}
Re: News module - link to detail of the news is showing summary instead of detail
I've asked one of the devs to see if he can recreate what you're experiencing as I'm not really following. In the meantime, can you make sure to include your CMSMS version and PHP version so we're comparing apples to apples?
Not getting the answer you need? CMSMS support options
Re: News module - link to detail of the news is showing summary instead of detail
Of course. I am using PHP 8.1 and CMSMS 2.2.14 (when I fix issue with News, I am going to update to most recent version).
Re: News module - link to detail of the news is showing summary instead of detail
Btw I am not sure if I can share the link here, but you can see the behaviour online on this page.
Re: News module - link to detail of the news is showing summary instead of detail
Hi again, I tried to upgrade CMSMS to most recent version and it broke everything. Web did not work anymore. So now I installed the most recent version from scratch and I'll try to restore everything via CMSMS admin using data from my database backup. So fingers crossed for me and I'll let you know. Thank you DIGI3.
Re: News module - link to detail of the news is showing summary instead of detail
Like I wrote earlier, DIGI3, thank you very much for your help. I've re-installed CMSMS with most recent version and using DB and data backup I filled everything back step by step. It is working again
.
Btw I am not sure for hundred percent (and I don't want to break anything so I don't want to test it), but I am almost sure that the issue was there because I forgot to add {content} into the template where I called {news}.

Btw I am not sure for hundred percent (and I don't want to break anything so I don't want to test it), but I am almost sure that the issue was there because I forgot to add {content} into the template where I called {news}.
Re: News module - link to detail of the news is showing summary instead of detail
That'll do it. Thanks for following up!
Not getting the answer you need? CMSMS support options