Page 1 of 1

[Solved] Wrong url after copy News module

Posted: Wed Dec 17, 2014 10:10 am
by Masweb
I've made a copy of the News module and called it "Reports".
Everything works fine exept the reference of the "read-more" url the module makes.

The module creates an url that doesn't exist. By clicking on it you will get an 404 page. The url look the same as in the News module but it's broken.

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 12:06 pm
by psy
IMHO and experience, it is bad practice to copy and rename modules on the same site. Upgrades are a nightmare.

Look at ListIt2 (aka ListItExtended) instead. LI2 can do everything News does and you can make as many modules/instances as you need.

Also, I believe News uses database-stored routes. You may need to go into Site Maintenance and 'Upgrade routes'. This may fix your problem OR it may make it worse...

Another solution for your Reports instance maybe CGBlog. This is based on News, does all News does and yet is independent of the News module.

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 12:55 pm
by Masweb
psy wrote:IMHO and experience, it is bad practice to copy and rename modules on the same site. Upgrades are a nightmare.

Look at ListIt2 (aka ListItExtended) instead. LI2 can do everything News does and you can make as many modules/instances as you need.

Also, I believe News uses database-stored routes. You may need to go into Site Maintenance and 'Upgrade routes'. This may fix your problem OR it may make it worse...

Another solution for your Reports instance maybe CGBlog. This is based on News, does all News does and yet is independent of the News module.
Thanks for your answers.

CGBlog is no option because it's already used.
Used Upgrade routes before but that didn't work
ListIt2 is an option but there are lots of reports in the module jet.
The urls of this are hand made in the url field but that not very user-friendly.

If someone has other options I will be very glad. Otherwise I'm going to copy all content to ListIt2.

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 1:00 pm
by psy
ListIt2 is an option but there are lots of reports in the module jet.
The urls of this are hand made in the url field but that not very user-friendly.
I don't understand what you're saying?

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 2:09 pm
by Masweb
psy wrote:
ListIt2 is an option but there are lots of reports in the module jet.
The urls of this are hand made in the url field but that not very user-friendly.
I don't understand what you're saying?
The website is in use so there are a lot of "report" items in yet.
If I'm going to use ListIt2 than I have to move al those item (I think by hand) to ListIt2.

Hope you understand me.

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 6:19 pm
by Dr.CSS
If you tried to remake News into another module there is a chance you may have missed a couple of places where it uses [nN]ews, I've done this before, it's actually how CGBlog was born...

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 7:00 pm
by Masweb
Dr.CSS wrote:If you tried to remake News into another module there is a chance you may have missed a couple of places where it uses [nN]ews, I've done this before, it's actually how CGBlog was born...
Found it in News.module.php

Can I change this to [nR]eport if I called the new module Report or isn't it that simple?

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 7:31 pm
by Dr.CSS
Yes but you left the n in there as it should be rR ...

I did a search replace to find all instances of:

1) news
starting with this, not case sensitive, helped find most all instances of the rest except the ews part
2) News
3) ews
4) NEWS

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 7:48 pm
by Masweb
Dr.CSS wrote:Yes but you left the n in there as it should be rR ...

I did a search replace to find all instances of:

1) news
starting with this, not case sensitive, helped find most all instances of the rest except the ews part
2) News
3) ews
4) NEWS

Great!!! :) Forgot the 3) ews

Works fine now!!! Thanks a lot!

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 9:27 pm
by Rolf
psy wrote:IMHO and experience, it is bad practice to copy and rename modules on the same site. Upgrades are a nightmare.
+1

Re: Wrong url after copy News module

Posted: Wed Dec 17, 2014 9:48 pm
by Masweb
Rolf wrote:
psy wrote:IMHO and experience, it is bad practice to copy and rename modules on the same site. Upgrades are a nightmare.
+1
You are right. But if you archive all the changes you can also do all the upgrades. Normally I don't copy but this times it was useful to do because of roles and rights.

Re: [Solved] Wrong url after copy News module

Posted: Thu Dec 18, 2014 5:32 pm
by Dr.CSS
I've found that once you run thru the search/replace routine it becomes easy to keep the module up to date, do it every time a new version comes out...

Re: [Solved] Wrong url after copy News module

Posted: Fri Dec 19, 2014 9:36 am
by psy
I've found that once you run thru the search/replace routine it becomes easy to keep the module up to date, do it every time a new version comes out...
True DrCSS, but then you have to remember which client, which modules, etc. The client will never know and in my experience, you'll never be able to bill for the extra work involved to upgrade each release. It was a decision you made, not the client, to go that way.

I tend to put it in the 'too hard basket'. After I've exhausted standard possibilities with News and CGBlog, I go to ListI2.