2

Please can someone help my sanity :)

I've followed many a blogs including this one : http://msdn.microsoft.com/en-us/library/office/gg549101.aspx#pj14_ModifyPWARibbon_TimesheetRibbon

It removes various buttons etc and is done via activating a feature. All is well in that the buttons are removed but I have behaviour which doesn't reflect the final screenshot they show. I've now tried this on two nevironments too. Whilst my buttons are removed i.e. the remove task button I can only assume some JavaScript error is being thrown (SharePoint swallows errors) as the whole ribbon fails to work. i.e. the drop downs now fail to show any content.

I've gone through and added some buttons back (commented code out) and eventually I can have the ribbon work with a select few of the changes BUT certain buttons break functionality! Is this because there is code trying to enable/disable buttons based on selected like the remove task and with it gone it errors.

Can someone please help my sanity and check this / feedback their experience and even better tell me what the hell I am doing wrong :)

3
  • SharePoint might appear to "swallow errors" if you don't know where to see them. Javascript errors still show up in the Developer Tools Console on IE8+. Also, feel like posting some code? It would make it a lot easier to help you with. Jul 27, 2012 at 16:26
  • Also, there's a code error in the example code. The PlannedTask code is missing the "CustomAction" identifier at the beginning of the tag. Jul 27, 2012 at 16:30
  • See comment on other answer. XML error fixed hence buttons DO hide! I'll post any JavaScript when back at the machine. I linked to the code!! Copy and paste with the customaction node fix.
    – Tezza
    Jul 28, 2012 at 20:02

2 Answers 2

1

The error in the example code is:

<!-- Remove the Planned check box for planned work in the Show/Hide group. -->
<
      Id="Ribbon.ContextualTabs.TiedMode.Home.ShowHide.PlannedWork"
      Location="CommandUI.Ribbon"
      Title="Hides the Planned check box in the Timesheet ribbon">
  <CommandUIExtension>
    <CommandUIDefinitions>
      <CommandUIDefinition Location="Ribbon.ContextualTabs.TiedMode.Home.ShowHide.PlannedWork"/>
    </CommandUIDefinitions>
  </CommandUIExtension>
</CustomAction>

Should be:

<!-- Remove the Planned check box for planned work in the Show/Hide group. -->
<CustomAction
      Id="Ribbon.ContextualTabs.TiedMode.Home.ShowHide.PlannedWork"
      Location="CommandUI.Ribbon"
      Title="Hides the Planned check box in the Timesheet ribbon">
  <CommandUIExtension>
    <CommandUIDefinitions>
      <CommandUIDefinition Location="Ribbon.ContextualTabs.TiedMode.Home.ShowHide.PlannedWork"/>
    </CommandUIDefinitions>
  </CommandUIExtension>
</CustomAction>

Try that out.

7
  • I spotted this and its sorted. Hence it does hide buttons as stated in my original post. It would do nothing if the XML was wrongly formatted. But the ribbon does not work well once those project server buttons are now hidden. I'll post the JavaScript error when I'm back at the machine. Can any one confirm this works fine for them? Do the drop down ribbon controls continue to work (are they populated).
    – Tezza
    Jul 28, 2012 at 19:59
  • I stripped the entire XML down to just hide the following:
    – Tezza
    Jul 30, 2012 at 9:45
  • <CustomAction Id="Ribbon.ContextualTabs.TiedMode.Home.Tasks.AddLine" Location="CommandUI.Ribbon" Title="Hides the Insert Row drop-down control in the Timesheet ribbon"> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location="Ribbon.ContextualTabs.TiedMode.Home.Tasks.AddLine"/> </CommandUIDefinitions> </CommandUIExtension> </CustomAction>
    – Tezza
    Jul 30, 2012 at 9:46
  • The control is hidden but the result is the ribbon breaks and the following JavaScript error is thrown:
    – Tezza
    Jul 30, 2012 at 9:46
  • SCRIPT5007: Unable to get value of the property 'childNodes': object is null or undefined
    – Tezza
    Jul 30, 2012 at 9:47
0

After thinking something was wrong with the Server, XML, feature, browser it turns out that the problem is a result of a caching issue!

Basically, one instance of the feature was deployed and activated called "RibbonChanges", later I revisited the solution and renamed the feature based on our standards so I renamed to "Company.RibbonChanges". In having the original feature deactivated and the original solution uninstalled and the new one installed and activated I thought all would be fine. Files on disk where as expected etc! It turns out however there is some caching issue on what I can only presume is the JS being outputted. A simple clear browser history/cache has fixed the issue!!

I also went through the process again, and the issue/outcome was the same.

EDIT: Any modification to XML in general seems to require a cache clear

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.