Support note:

In most cases support requests concern a conjunction of joomla extensions, settings and content. It's not an easy task to install the same extensions, set it up in the same way and generate the test content close to your content. So to get the support be ready to provide either Joomla superadmin access or an akeebabackup of your web-site. Your web-site copy will be installed at a test server to be debugged.

If you are afraid of some data, then either create an akeebabackup excluding your secret data or create a test web-site instance with fake data yourself and provide the developer with the access.

If for some reason you are not able to provide the access or to create an unsecret web-site backup/instance, then support costs 20 USD per hour.

MVC Override - change joomla extensions behaviour without changing core files

Download latest version

Total extension downloads: 11511

Comments   

Izod
# Izod 2013-08-20 22:43
It seems to me that mvc-override has problem handling com_k2 correctly. Here's the fatal error I'm receiving. Note the wrong handling of the component's name (e.g. KDefault2View instead of K2DefaultView)
Quote:

Fatal error: Class 'KDefault2View' not found in F:\wamp\www\plugins\system\mvcoverride\mvcoverride.php(352) : eval()'d code on line 16
Gruz, it would be great if you could correct this issue, otherwise I have to downgrade to the 2012 extension, Plugin Override. Thank you so much, anyway!
gruz
# gruz 2013-08-20 23:04
How can I reproduce the error? I have no experience working with K2 at all. Can you create a joomla install with the problem and provide me?
Izod
# Izod 2013-08-21 08:21
I think It will be very hard for me to do. But if this is the only way to go, then please tell me how should I do that. Probably it's much easier for you to just install the k2 extention, create an item, try to override a model or view, and then go to the item's link to see the error.
gruz
+1 # gruz 2013-08-21 11:36
Izod, I develop for free, support for free, don't get any benefit or profit, no donations, this doesn't work as any advertisement as nobody offers any job. I do it just to help people like you.

I think if YOU need free help, then please strain and make my part of work as easy as possible. I cannot reproduce all problems for all users. Even if reproducing is rather easy, I don't want to switch my brain to reproduce it, to duplicate all curcamstances. I just want to solve THE PROBLEM.

If you are working with MVC override, your are surely professional enough to provide an akeebabackup copy of your web-site. Or create a copy or your web-site, remove your confidential info, and provide it's backup.

When trying to reproduce a problem, I just, mainly lose my time. Like this your example.

It works for me.




Here is my override snippet
Code:
basePath:|:components/com_k2/views/item/view.html.php
className:|:K2ViewItem
option:|:com_k2
scope:|:site
changePrivate:|:0
includes:|:administrator/components/com_k2/views/view.php,tmp/m2.php
code:|:class K2ViewItem extends K2ViewItemDefault
{
function display($tpl = null)
{
JFactory::getApplication()->enqueueMessage('If you see this message, then ovveride works', 'message');
parent::display($tpl);
}
}


Now you will try to explain what additional circamstances are needed to reproduce your problem. I will have to switch again to the task, open files, understand your instructions and implement them and so on. Everything this can be avoided if you have provided a problematic web-site backup.
Izod
# Izod 2013-08-21 15:25
You're right, Gruz, I apologize. Please check your email. I have send you an akeeba backup file.
brbaso
# brbaso 2016-09-22 13:56
Found that _autoOverride method in the plugin causes:
PHP Fatal error: Cannot redeclare class JoomcareerModelJobsDefault in /[somepath]/plugins/system/mvcoverride/mvcoverride .php(610) .

It happened on linux/apache, live J3.6.2 Installations and with overriding JoomCareer jobs model.

After commenting out $this->_autoOverride(); line in the onAfterInitialise plugin's function it worked .

The error didn't appear on local XAMPP installation though.

Plugin was set according to 'Using any file path and plugin settings' instruction on this page.

While trying to examine the problem I found that it had something with difference between paths on a local Windows XAMPP server and live Linux/Apacche server. ...

Hope that this makes some sense and that it would help someone.
gruz
# gruz 2016-09-22 14:05
Can you please give me an akeebabackup of the web-site with the problem so I can fix the bug?
brbaso
# brbaso 2016-09-22 21:56
Yes I could make it, but I think that better approach would be if you just 'insist' on setting up the plug in in back end and forget '_autoOverride()' ... (it is something about 'Fallback to Julio's method for backwards compatibility' if I understand correctly) ..
Thanks for replying to my post.!
gruz
# gruz 2016-09-22 21:59
I thought in such a way before as well. But lately I met a project where I needed many quick overrides.
And autoOverride was very useful. I improved it much. Now I think _autoOverride should be the default approach used if you are not planning to copy-paste quickly the same code overrides between several Joomlas via plugin settings.
brbaso
# brbaso 2016-09-22 22:49
how to send you any data ? attachment or what. I tried to send some comment but got it is too long ...?
gruz
# gruz 2016-09-22 22:54
Just use email :-) You can find it in the web-site menu.
brbaso
# brbaso 2016-09-23 11:54
The problem ' PHP Fatal error: Cannot redeclare class ... ' solved:
When you choose to setup the plugin to use your override code for 'Override Class Path' in the plugin settings DO NOT use following paths:
JOOMLAROOT/code/
JOOMLAROOT/administrator/code/
JOOMLAROOT/templates/yourtemplate/code/
So, place your override code whenever you want and define the Override Class Path to point to your override code.

Thanks Gruz for clearing this. ! :-)
Hamlet Kraskian
+1 # Hamlet Kraskian 2016-10-20 12:41
I tried to test given examples, so there is no additional thing done by myself.
In a multilingual site, joomla 3, last version.
1- When "search engine friendly urls" are disabled.
- The com_content example works as supposed.
- The com_users example doesn't fire. more specifically

2- When "search engine friendly urls" are enabled.
and
a -mvcoverride plugin is load first of all
- sometimes (in default en language:) " View not found [name, type, prefix]: registration, html, contentView"
- In other language : Brings a blank screen.

b- mvcoverride plugin is load after language filter plugin
- sometimes (in default en language:) doesn't fire
- In other language : doesn't fire


The view in com_content works in all cases correctly.
gruz
# gruz 2016-11-10 18:31
Fixed in the latest versions.
Ravia
# Ravia 2016-11-22 17:54
I installed the plugin (thank you so much) and have it configured I thought properly, but am getting a white screen with no errors on the front end (back end is accessible) in Firefox, and HTTP ERROR 500 in Chrome. I've tried both the textarea and file options. I'm trying to override /components/com_community/controllers/profile.php; a JomSocial file.
Not sure how to give access without publicly posting information. What did I do wrong? Thank you!
gruz
# gruz 2016-11-22 19:26
Email me. The web-site menu has an appropriate link with the email.
achartier
# achartier 2017-08-10 23:22
Hi Gruz, I am getting the zero file length issue you attempted to fix in the previous release. It only occurs in brute mode and I need this to pick up the overrides, they don't pick up otherwise.

Has there been any further investigation into this?
gruz
# gruz 2017-08-11 00:32
I suspect I need to investigate at first you web-site akeebabackup. If it doesn't occurs at the local copy extracted from the akeeba, I'd have a look and experiment at your server.
achartier
# achartier 2017-08-25 17:02
Gruz,

Is it possible this problem is occurring due to an attempt to unlink the lock file being it is unlocked?

Line 443 is attempting to unlink the lock file but there is an exclusive lock on it which is released in the subsequent line.
gruz
# gruz 2017-08-25 17:20
Maybe. Can you give a try to experiments?

There is a possibility you don't need brtute force mode. In the comment below by Hartmut we investigated his case. We needed to override a Kunena library file to make other overrides possible. Sometimes one more override solves the problem. Brute fores in unreliable, as it turns out.

Please also try the latest version version. Just released. Includes several fixes insipred by Hartmut's situation.
achartier
# achartier 2017-08-25 18:01
I will try the newest version. I tried running without brute force and the overrides did not take.
gruz
# gruz 2017-08-25 18:04
I have not understood me. I don't mean the new version sill solve you situation. I mean maybe it's possible to add an override to the place, which block normail overrides.

This depends on the situation. I must experiment with your site (or ti's copy)_to be sure.
achartier
# achartier 2017-08-25 18:05
Funny, I no longer see where I set brute force mode. Is this a change since this version?
gruz
# gruz 2017-08-25 18:06
No. It should be there.
achartier
# achartier 2017-08-25 18:36
Do you mean Expert mode?
achartier
# achartier 2017-08-25 18:38
When I turn Expert mode off the overrides do not apply. In fact I get 500 errors on the pages that the classes are on.
gruz
# gruz 2017-08-26 00:03
Yes, I mean expert mode.

What are you trying to override? Can I have a look at the code?
achartier
# achartier 2017-08-27 18:17
I will send you an email with the particulars.
Hartmut
# Hartmut 2017-08-16 14:26
Hi Gruz,

I am facing the same problems with the zero file. I have to override the com_kunena/controllers/user.php, which works in expert mode only.
However, it makes the core user.php empty and the leads to 404 error.
In basic mode the plugin does nothing for this override.

Unfortunately if the plugin is in expert mode, it sets also other (Joomla!) core files which are overrideden, to zero, which then spoils more functions.
Would be great if you could find a solution

Locally it works, only on live site not.

Could it be in connection with write permissions (folder 755/ files 644)?

Please to hear :-)

BRGDS
Hartmut
gruz
# gruz 2017-08-16 14:30
Hi.
I need to test at your code at your server.

I first I must be sure expert mode is a must (this I can do at my local host with your web-site copy). If it's a must, and it works at locahost, them I must experiment at your server (maybe at a subfolder not to affect the production web-site).

I must catch the moment the file is not restored as expected to find a workaround.
Hartmut
+1 # Hartmut 2017-08-16 14:56
Hi Gruz,

Thanks for swift reply.

I will set up a copy of the live side and give you the credentials when done. This will be probably within the next few day.

Will revert :-)

BRGDS
Hartmut
Hartmut
# Hartmut 2017-08-18 21:09
Hi Gruz,

you have an email :-)

Best Regards
Hartmut
m.noroozy@yahoo.com
# m.noroozy@yahoo.com 2017-08-20 10:44
Hello

This plugin can override libraries\joomla\mail\mail.php ?
Thank you
gruz
# gruz 2017-08-21 06:06
I have tested. Not, it's not possible. The JMail class if loaded by Joomla before "onAfterInitialise" event happens so it's not possible to do anything with this.
rogerco
# rogerco 2018-11-12 17:18
Hi,
Having difficulty seeing how to override an XML form file on the admin site.
Trying to replace - filter_tags.xml in /administrator/components/com_tags/models/forms to add a new filter field.
Overriding the model itself (tags.php in /administrator/components/com_tags/models/ ) works as described ok but I can't see how to set up the plugin rule to override the form as well.
I have tried putting the new form in various places (in the admin template isis or system and in /plugins/system/mvcoverride/code and various subfolders of these but it is never found.
If it requires a rule to be set then what value should go in the Base Class Name field? I have tried leaving it blank.

I am probably missing something basic in my understanding - could you provide an example for the setup for overriding a model form xml. The documentation doesn't make it clear how the plugin should be setup for this.
gruz
# gruz 2018-11-12 21:01
Hi.
It was not working for the filter_tags.xml

Try the latest RC
https://gruz.ml/en/component/ars/repository/mvcoverride/1-1-27-rc/j3_plg_system_mvcoverride_1_1_27_rc_build_2-zip.zip

I copied
administrator/components/com_tags/models/forms/fil ter_tags.xml
to
administrator/templates/isis/code/com_tags/models/ forms/filter_tags.xml

and it worked.

Please let me know if it works so I can release the latest version.
rogerco
# rogerco 2018-12-01 23:30
Sorry for the delay replying, the notification got trapped as spam on the mail server so I have only just caught it.

In fact I solved the problem by using the Form XML Override extension from iCue in addition to MVCoverride.

I will try and test RC 1.1.27 next week as it would be nice to only have one plugin to do the whole job.

Thanks
RCO

Please register to post comments.

Version 1.1.27 Release Candidate

Released on: Monday, 12 November 2018

Version 1.1.26 Stable

Released on: Wednesday, 31 October 2018

Version 1.1.25 Stable

Released on: Friday, 04 May 2018

Version 1.1.24 Stable

Released on: Thursday, 29 March 2018

Version 1.1.23 Stable

Released on: Thursday, 01 March 2018

Version 1.1.22 Stable

Released on: Thursday, 01 March 2018

Version 1.1.21 Stable

Released on: Wednesday, 21 February 2018

Version 1.1.20 Stable

Released on: Wednesday, 31 January 2018

Version 1.1.19 Stable

Released on: Wednesday, 31 January 2018

Version 1.1.18 Stable

Released on: Friday, 19 January 2018

Version 1.1.15 Stable

Released on: Tuesday, 26 September 2017

Version 1.1.14 Stable

Released on: Friday, 25 August 2017

Version 1.1.13 Stable

Released on: Wednesday, 12 April 2017

Version 1.1.12 Stable

Released on: Saturday, 25 March 2017

Version 1.1.11 Stable

Released on: Saturday, 26 November 2016

Version 1.1.10 Stable

Released on: Saturday, 26 November 2016

Version 1.1.9 Stable

Released on: Tuesday, 25 October 2016

Version 1.1.8 Stable

Released on: Tuesday, 25 October 2016

Version 1.1.6 Stable

Released on: Monday, 03 October 2016

Version 1.1.5 Stable

Released on: Friday, 09 September 2016

Version 1.1.4 Stable

Released on: Friday, 09 September 2016

Version 1.1.3 Stable

Released on: Friday, 09 September 2016

Version 1.1.2 Stable

Released on: Monday, 29 August 2016

Version 1.1.1 Stable

Released on: Sunday, 28 August 2016

Version 1.1.0 Stable

Released on: Saturday, 27 August 2016

Version 1.0.22 Stable

Released on: Tuesday, 16 August 2016

Version 1.0.21 Stable

Released on: Monday, 08 August 2016

Version 1.0.20 Stable

Released on: Sunday, 07 August 2016

Version 1.0.19 Stable

Released on: Saturday, 06 August 2016

Version 1.0.18 Stable

Released on: Sunday, 31 July 2016

Version 1.0.17 Stable

Released on: Thursday, 28 July 2016

Version 1.0.16 Stable

Released on: Thursday, 28 July 2016

Version 1.0.15 Stable

Released on: Thursday, 28 July 2016

Version 1.0.14 Stable

Released on: Thursday, 28 July 2016

Version 1.0.13 Stable

Released on: Thursday, 28 July 2016

Version 1.0.12 Stable

Released on: Friday, 20 May 2016

Version 1.0.11 Stable

Released on: Thursday, 22 August 2013

Version 1.0.10 Stable

Released on: Tuesday, 20 August 2013

Version 1.0.9 Stable

Released on: Monday, 05 August 2013

Version 1.0.8 Stable

Released on: Wednesday, 17 July 2013

Version 1.0.7 Stable

Released on: Wednesday, 17 July 2013

Version 1.0.6 Stable

Released on: Wednesday, 17 July 2013

Version 1.0.5 Stable

Released on: Wednesday, 17 July 2013

Version 1.0.4 Stable

Released on: Monday, 15 July 2013

Version 1.0.3 Stable

Released on: Monday, 17 June 2013

Version 1.0.2 Stable

Released on: Friday, 05 April 2013

Version 1.0.0 Stable

Released on: Friday, 05 April 2013

Version 1.0.1 Stable

Released on: Friday, 05 April 2013

FaLang translation system by Faboba
ОУН-УПА: легенда спротиву Українська Дивізія «Галичина» Зиновій Книш: спогади й матеріали до діяння УВО і ОУН Реаніматор електронних текстів Забуттю не підлягає 1917-1991

See a typo?

Select the text block and press

CTRL+Enter

Comments

  • AutoReadMore - automatic read more for Joomla

    gruz gruz 16.01.2019 13:41
    Hi. Currently it's not possible to make intotext as the link. If you badly need, mail me, I'll try ...

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    mrwad mrwad 13.01.2019 13:23
    Dear Gruz! One more question. Is there any way to hide and make (blog text) clickable instead?

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    mrwad mrwad 27.12.2018 22:25
    My bad! Thank you for great plugin!

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    gruz gruz 27.12.2018 00:09
    Hi. Did you try setting "Strip Formatting" to yes?

    Read more...

     
  • AutoReadMore - automatic read more for Joomla

    mrwad mrwad 26.12.2018 21:16
    Dear Gruz! Thank you for awesome plugin! That saved a lot of time for me developing websites! I have ...

    Read more...