New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inheritable menu item property #13766
Inheritable menu item property #13766
Conversation
… Administrator management at the Menus:Edit Item level.
… Administrator management at the Menus:Items level.
hmmmm. This is my 1st Pull Request. |
The Travis one takes long to finish. That's normal. |
Yes, I noticed what you explained. |
I've fixed a number of errors, but I'm not sure what to do with ones like this:
Ther error message for the above is:
Should I add
This is a bit pedantic, not to mention that I didn't write those lines yet they were in the repo. |
…d other Travis, trivial, Error fixes.
Just push them like you did, it will trigger Travis again. You can do that as many times you want 😄
There is a space at the end of the first line. That's probably the cause.
It should only show errors for lines you changed something. |
Thanks for your assistance. |
Try to fix the others first, maybe Travis choked somehow.
|
After two editors (Notepad++ and UEStudio), there are no extraneous spaces. The |
Well, the long list is gone (DOS formatting issue I think) but the rest are bogus error and should be warnings really. I'm done. |
Travis is just enforcing the codestyle rules we have (see http://joomla.github.io/coding-standards/). If they not pass, this PR will never be accepted. |
Ok, I will try getting help. :) Thanks for yours. |
I've installed PHPCodesniffer. I'll see how I do tomorrow. |
Could someone help me with running PHPCS? I'm getting this error:
when I run the command:
|
From the root folder of the Joomla repository, when I run (as per the Joomla! Coding Standards Manual) CodeSniffer, I get an error. Considering I'm trying to fix documentation issues, this is demoralising. The command:
Generates this error:
Including /path/to// in the command makes no difference. It took less time to write the code than it has to figure out how to include the right number of spaces in the documentation. |
…remove it and make a commnet to alert the next person.
I can't help you with setting up codesniffer. I always rely on Travis. Much simpler 😄 Anyway, you seem to have figured out most issues. The only one left is a line lenght where you can just wrap it. |
Thanks Bakual! Without your encouragement, I think I may have given up. Yes, I split the SELECT statement into an additional line. I gave up on CodeSniffer for the moment, but I would like to get it working in the end. Wallah, it's passed!!! :) |
@Bakual, what do you mean by "The update files are missing." Also, I haven't tested the repo version, but would really like too! I've been working with the files I have in my 3.6.5 Stable-Full install. |
Travis needs a break! I am running PHP v5.3 and it works on my system yet Travis failed. I did not make any changes to the file:
How do I make the system perform another check when there is no code I wish to alter? Do I need to make a 'dummy' change just to trigger Travis/Jenkins? |
@infograf768 |
Look at https://github.com/joomla/joomla-cms/tree/staging/administrator/components/com_admin/sql/updates/mysql. It contains the files which are applied during an update. There are similar forlders for the other databases. |
Just download your branch as zipfile (https://github.com/Napoleon-BlownApart/joomla-cms/archive/inheritable.zip)
We can restart it manually if needed. |
…es/cms/menu/menu.php). Fixed syntax error in admin/comp/com_menus/helpers/html/menus.php
I've been able to do a local build which has created the full and update installers. |
You can try if you apply the PR using the patchtester (joom.la/patchtester) and then use the database fixer. Or you can upload the zip from your branch in a 3.6.5 installation using the Joomla Updater. Both ways should apply the update SQL files |
The error in the unit tests means you either broke something with you PR or the tests need to be adjusted to your change. It looks like fetching the active menu item is broken. |
This pull request is reverting several changes that have been made since 3.6.5, those must be reapplied for this to be considered. |
@Napoleon-BlownApart Did you create your PR based on a 3.6.5 installation? If so that would explain what Michael said. You need to create the PR based on a current staging branch. |
@Bakual, yes, that was how I originally developed it. However, for the pull request I rewrote and tested using Eclipse PDT and its debugging features. It's not like I copied code from my 3.6.5 install. From the latest commit in my branch (and pushed back to github), the build produced a FULL installer (Joomla_3.7.0-beta1-dev-Full_Package.zip) and it works fine for me. (I don't believe Travis, but what can I do?) I'm stuck on the update installer because the Joomla 3.4.8 I'm trying to upgrade will not allow me to upload the patch (like you can with extension installs) and wants to access an update server. Even with it set to Custom URL its not working and I haven't been able to figure out the right setup to mimic an update server even though I've handcrafted the xml files to suit. I've included a link to the Joomla systeminfo from my FULL install. Thus far I've been working with U14's default php5.5.9. I have now installed php 5.6 and 7.0 on my dev server and will continue with this. Head to head with Travis until it works. @mbabker: With regards to reverting code, the only place that occurred was in the JMenu constructor (/libraries/cms/menu/menu.php : line 83) because code was removed not fixed, and thus the item's parameters weren't being put in the registry. This was causing errors for me down-stream. I will find a better way of doing this. I can't upload the text file as an attachment. The error message I get in the window below is: |
@Bakual & @mbabker : I updated my previous comment. And uploaded a System Info text file to https://www.abms.net.au/public/systeminfo-2017-01-29T14_53_04+11_00.txt which is using php 5.6 |
The code was changed in a way to lazy load the parameters. See #13073 You need to get your changes in sync with the current development branch, not the 3.6.5 release. From the looks of things you're trying to port code from two different versions which just won't work efficiently, especially when there have been several other changes (query caching in JMenuSite and that PR I linked above being two changes reverted). |
I don't think it works in 3.4.8. The ability to upload a zip directly in the Joomla Updater was added in 3.6.0 or 3.5.0. |
@Bakual : Yes, I installed 3.6.0 and now am able to use the udate feature. Unfortunately my update failed, and I will debug it after I fix up the issues @mbabker raised. @mbabker : I will go through my changes again, from a fresh start, but a little advice would help here. I would like to start this from a fresh 'staging' state. So what I'm thinking is to delete my branch, create it again, and then proceed to make the changes necessary for the Inheritable again. Is this a feasible approach? I don't want to leave this PR (thread) hanging, and I don't want to be developing a poluted brach that is going to give everyone headaches. If the above isn't feasible, what would you recommend? Also, since a week has gone by, should I be looking to get a more up to date 'staging' branch? |
I have deleted the Inheritable branch and then recreated it. I will reproduce the changes whilst being mindful of the above comments. |
I have committed the first stage; Inheritable property managed in the |
Ok, why am I not able to "Reopen and comment"? |
I have updated the Test Instructions (Setup) to include:
|
Locally, I am able to build both the full and update packages and have tested both here. Now I wish Travis would wake up and run my tests..... |
Pull Request for Issue #13682.
I have implemented an Inheritable property for menu items. The property determines if higher access levels inherit the menu item. An inheritable menu item will display in the menu for all user groups who inherit visibility of the menu item's set access level. A menu item set to un-inheritable will only be seen by users who belong to the access level group that is set in the menu item.
For example:
With a "Register" menu link (whose access is set to Public with Inheritable NO), a public visitor to the site will be able to register, but once they have activated their account and been upgraded to the Registered user group, they will not see the "Register" link while they remain logged in (assuming the user is not assigned to the Public User Group on the User:Edit-Assigned User Groups screen).
Had the Inheritable property been left ON (default), the menu item's behaviour would have been standard Joomla behaviour, and the Registered user would still be able to see the "Register" link (unless a separte menu was created for registered users or some other hack was implemented).
The Inheritable property is a binary switch. Its setting can be controlled on
1 Menus:Edit Item -> Details screen using the standard binary toggle switch.
2 Menus: Items screen using a button similar to the 'Status -> Publish' button.
From various posts I have read concerning this issue, I believe this to be a simple, elegant, unobtrusive solution to this particular problem. It would be nice if a future release of Joomla incorporated this change, or something similar. For justification of this enhancement, I refer the reader to the Issue post I published #13682
The details of the changes are in the git-diff below.
Cheers,
Nap
Summary of Changes
The changes made apply to the Staging Branch of the Joomla repository as of 24 Jan 2017.
My changes are located in the 'inheritable' branch.
There are two commits; the first is the Menu:Edit Item implementation, the second implements the Menu:Items summary screen changes.
From the Menu:Items screen, you cannot set the Default page to un-inheritable (like you cannot un-publish the home page). I haven't tested this at the Menu:Edit Item level.
SQL changes have been applied for all three database types: MySQL, PostGRE, and SQLAzure.
Testing Instructions
As a novice Joomla contributor/user, these should be tested further in regards to side-effects of extensions and templates.
Menus:Edit Item
Works fine for me.
Menu:Items admin management
Works fine for me.
Documentation Changes Required
The code I've added is documented in compliance with Doxygen. The '@SInCE field for methods has been set to 2017-01-25'.