Skip to content

Conversation

@bembelimen
Copy link
Contributor

.

@infograf768
Copy link
Member

Please explain the reason behind this change as well as testing instructions.

@bembelimen
Copy link
Contributor Author

Hello,

the only reason is, that the default language is always a star (*). So I thought, it's a good idea to set the star as default parameter. An example:

$id = 102; // any valid menu ID
$menu = JFactory::getApplication()->getMenu();
$menu->setDefault($id);
$default = $menu->getDefault();
print_r($default);

I think, this two methods should be compatible. (Test the code before and after the patch)

@Hackwar
Copy link
Member

Hackwar commented Jan 4, 2015

@test This is a correct fix.

@jacxx
Copy link

jacxx commented Jan 4, 2015

@test, I have tested the fix and work. Jacxx :)

@wilsonge
Copy link
Contributor

wilsonge commented Jan 5, 2015

I can't imagine how setting the default home page item gets set outside of menu manager. But indeed it seems correct to use the same standardisation here as we have for the default value in com_menu's itself

@Hackwar
Copy link
Member

Hackwar commented Jan 5, 2015

There are several reasons to set the default home page. For example, I had to write a plugin that made a menu item the default page when the user first opened the page via some landing page. Remember that this is not set permanently, but only sets the default page in JMenu for the duration of the pageload.

@bembelimen
Copy link
Contributor Author

Yep, I wrote a multi domain plugin (that's the reason why I found this "issue") where I set the default page depending on the domain.

@zero-24
Copy link
Contributor

zero-24 commented Jan 5, 2015

moving to RTC since we have successdful tests by @Hackwar and @jacxx Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4342.

wilsonge added a commit that referenced this pull request Jan 6, 2015
Made default language parameter from setDefault equal to getDefault
@wilsonge wilsonge merged commit 11504d0 into joomla:staging Jan 6, 2015
@wilsonge
Copy link
Contributor

wilsonge commented Jan 6, 2015

Merged - thanks!

@wilsonge wilsonge added this to the Joomla! 3.4.0 milestone Jan 6, 2015
@bembelimen bembelimen deleted the patch-18 branch January 23, 2015 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants