Page 1 of 1
News module - link to detail of the news is showing summary instead of detail
Posted: Fri Feb 07, 2025 8:18 am
by svezij
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
Posted: Fri Feb 07, 2025 3:06 pm
by DIGI3
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.
Re: News module - link to detail of the news is showing summary instead of detail
Posted: Mon Feb 17, 2025 1:16 pm
by svezij
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:
Code: Select all
if ($modulename == 'News') {
echo $mactmodulename . '<br />';
echo $checkid . '<br />';
echo $id . '<br />';
echo $mactaction . '<br />';
echo ($mactinline ? 'True' : 'False') . '<br />';
exit();
}
I got:
So I tried to change the url from original
Code: Select all
mact=News,cntnt01,detail,0&cntnt01articleid=5&cntnt01origid=33&cntnt01detailtemplate=blog_detail&cntnt01returnid=33
to
Code: Select all
mact=News,m53286,detail,1&m53286articleid=5&m53286origid=33&m53286detailtemplate=blog_detail&m53286returnid=33
-> 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
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"
}
Still not any idea what am I doing wrong?
Re: News module - link to detail of the news is showing summary instead of detail
Posted: Mon Feb 17, 2025 11:57 pm
by DIGI3
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?
Re: News module - link to detail of the news is showing summary instead of detail
Posted: Tue Feb 18, 2025 12:47 pm
by svezij
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
Posted: Tue Feb 18, 2025 12:52 pm
by svezij
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
Posted: Thu Feb 20, 2025 12:59 pm
by svezij
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
Posted: Tue Feb 25, 2025 9:14 pm
by svezij
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}.
Re: News module - link to detail of the news is showing summary instead of detail
Posted: Tue Feb 25, 2025 9:31 pm
by DIGI3
That'll do it. Thanks for following up!