News module - link to detail of the news is showing summary instead of detail Topic is solved

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
User avatar
svezij
New Member
New Member
Posts: 6
Joined: Fri Feb 07, 2025 8:04 am

News module - link to detail of the news is showing summary instead of detail

Post 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.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1755
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: News module - link to detail of the news is showing summary instead of detail

Post 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.
Not getting the answer you need? CMSMS support options
User avatar
svezij
New Member
New Member
Posts: 6
Joined: Fri Feb 07, 2025 8:04 am

Re: News module - link to detail of the news is showing summary instead of detail

Post 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:

Code: Select all

News
cntnt01
m53286
detail
False
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?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1755
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: News module - link to detail of the news is showing summary instead of detail

Post 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?
Not getting the answer you need? CMSMS support options
User avatar
svezij
New Member
New Member
Posts: 6
Joined: Fri Feb 07, 2025 8:04 am

Re: News module - link to detail of the news is showing summary instead of detail

Post 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).
User avatar
svezij
New Member
New Member
Posts: 6
Joined: Fri Feb 07, 2025 8:04 am

Re: News module - link to detail of the news is showing summary instead of detail

Post by svezij »

Btw I am not sure if I can share the link here, but you can see the behaviour online on this page.
User avatar
svezij
New Member
New Member
Posts: 6
Joined: Fri Feb 07, 2025 8:04 am

Re: News module - link to detail of the news is showing summary instead of detail

Post 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.
User avatar
svezij
New Member
New Member
Posts: 6
Joined: Fri Feb 07, 2025 8:04 am

Re: News module - link to detail of the news is showing summary instead of detail

Post 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}.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1755
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: News module - link to detail of the news is showing summary instead of detail

Post by DIGI3 »

That'll do it. Thanks for following up!
Not getting the answer you need? CMSMS support options
Locked

Return to “CMSMS Core”