New MVC GSOC 2014

https://groups.google.com/forum/#!topic/joomla-dev-cms/AH6piuw2IR0

http://gwilson.org/index.php/new-mvc
Sorry if I sound preachy. I do make it a point to practice as much if not more than I preach. 

I'm not saying developers should override strings, I'm just saying they could. I don't think Joomla should worry about how they accomplish said overrides. 

In this case, if indeed I am mistaken and the mob comes pitch forking, the worst case scenario is we add the prefix again. However since that doesn't require changing the interface or return types, there is no BC to worry about. 

Also if they REALLY wanted to override strings, I would suggest overriding the controller::setMessage method. Since they'll know what to expect, mapping to their overrides won't be hard. 

Something like: 

If($msg = JText::_('STANDARD_STRING'))
{
    $msg = JText::_('CUSTOM_STRING');
}

All their logic in one place, all the conditionals gone from the core MVC, predictable behavior, no untranslated strings, no mandatory copy/paste and DRY INI's 

That's a Win-Win-Win-Win-Win-Win situation. My favorite kind. =^D


Sincerely,
Mathew Lenning

Babel-university.com

P.S. This message was sent via iPhone, so please forgive any errors

> On Aug 24, 2014, at 9:17 PM, Thomas Hunziker <notifications@github.com> wrote:
> 
> In libraries/cms/model/actions.php:
> 
> > +				// Trigger the onContentBeforeDelete event.
> > +				$result = $dispatcher->trigger('onContentBeforeDelete', array($context, $activeRecord));
> > +
> > +				if (in_array(false, $result, true))
> > +				{
> > +					throw new RuntimeException($activeRecord->getError());
> > +				}
> > +
> > +				$activeRecord->delete($pk);
> > +
> > +				// Trigger the onContentAfterDelete event.
> > +				$dispatcher->trigger('onContentAfterDelete', array($context, $activeRecord));
> > +			}
> > +			else
> > +			{
> > +				throw new RuntimeException($this->text_prefix . '_ACL_ERROR_DELETE_NOT_PERMITTED');
> Juts for the record. It wasn't me who said the developer needs to override the message. I'm perfectly fine with a generic message myself, also for using "records" or "items" instead of "banners", "weblinks" and "articles. I do that already fine in my own extensions where I deal with multiple item types. So you're technically preaching to the wrong audience 
> 
> I thought you proposed a generic global string which should be overriden by the extension if needed. That was the part I completely disagree with. I'm perfectly fine with using a generic string. Just not with overriding it in an extension as it will create issues sooner or later.
> If the extension needs a customised text, it has to override the code and use an own string.
> 
> We may provide a way to do that easy, maybe by allowing to set a speciifc prefix to be used in the class which defaults to a generic one or by using checks if a given key exists. I'm not saying we must, but we could if it's important.
> 
> So I feel like we think the same actually.
> 
> \
> Reply to this email directly or view it on GitHub.