Fix broken HTML widgets

    Summary

    The HTML widget can get bad HTML or JavaScript in it and prevent anyone from being able to edit it.  To work around this, you need to clear out that HTML widget from the database.

     

    Issue Details

     

    Work Around

    1. Find the container id.

    This will be the ID number of the space, group, project, etc.  If you have only the display name (URL) of a social group for example, you can find the ID in the database by using a similar query to the following:

    SELECT * FROM jivesgroup WHERE displayname='my-secret-group';
    

     

    2. Run this, plugging in parentobjectid and parentobjecttype (14=community, 700=social_group, 600=project, 3=Your View)

    Don't forget to replace the #### below with the IDs obtained above.

    SELECT * FROM jiveWidgetFrmProp WHERE name='html' AND frameid IN
      (SELECT frameid FROM jiveWidgetFrame WHERE 
        parentobjecttype=## AND parentobjectid=#### AND
        widgetid IN (SELECT widgetid FROM jiveWidget WHERE classname='com.jivesoftware.community.widget.impl.HtmlTextWidget'));
    

    The Default Your View is (parentobjectid=-2147483648 AND parentobjecttype=3)

    You'll likely find two of the same widget, one for published and one !published.

     

    3. Empty out the widgets based on frameid

    UPDATE jiveWidgetFrmProp SET propvalue='' WHERE (frameid=#### OR frameid=####) AND name='html'
    

     

    4. Restart the Site.

    There is no cache that can be flushed to update the widget layouts.  A rolling restart is fine.