Neos Editor - Deleted Nodes reappear after page reload - neoscms

I created a new Neos Instance, using the Sandstorm Neos Kickstart. After importing the content dump via ./flow site:import my.site I got some content elements which I deleted using the editor and published my changes. After a page reload I noticed that nodes were their again.
I also noticed that the outline of the elements is orange and not blue, is this the problem? And what does it mean?
Thank you!

The orange outline means, that these nodes shine through from another dimension.
Inside the kickstart package there currently is a (german) content dimension configured. However the site export uses nodes without a specific dimension, which leads to nodes shining through from "no dimension" to your dimension.
To fix this you can run ./flow site:prune and add your content dimension to the site export by replacing the self closing <dimensions/> with:
<dimensions>
<language>de</language>
</dimensions>
(You would have to do this on every node, of course!)
Afterwards you need to import the site again, to make it all work.
(I assume that this will be fixed inside the kickstart package site export, soon)

Related

Manage image deletion in a WYSIWYG editor

When an HTML editor is used and images are added from the local computer, they are uploaded to a server and a link is obtained to put it in the image src attribute. What happens when the img element is removed from the editor? How would the image be deleted from the server? In this case I understand that the image deletion event could be detected and then call a service to delete it. But what happens if the user adds a new image and leaves the page? How would it be deleted in these cases?
In both cases, if the deletion of the images is not managed, it could happen that the server is filled with unused images. How do you usually solve this problem? How is the proper way to solve this?
That's a nice question there. And yeah, for sure the server would fill up with unused images in some point. I'm not an expert on this but I'll try to suggest something so I can implement it too in my WYSIWYG editor haha. I suppose you have a custom modal for the insertion of the image. Upon clicking the button you could save the image link to an array and at SAVE || on leaving the document edit || on popstate event you could make a regex that checks the innerHTML of the editor for the specific SRC. If is not found then you could push an ajax request with the image name so you can deleteit. For sure there are more efficient and complex ways to achieve that. Such as creating text ranges and track elements on keydown - Backspace(8) / Deletekey(46).
An other way is that you could track the images that are in use. When the document is saved regex out the images in the document, push them to a db table and periodically make a check from the back end so you can delete those that are not in use.
I don't know if my suggestions are helpful or not. I just saw an interesting subject so I jumped in. Cheers mate.

Building Blocks not appearing after upgrade to Word 2013

I have a document-level (dotx) customization, with a custom ribbon, and one of the controls in that ribbon is this:
<gallery idMso="CustomGallery1" label="Building Blocks" size="large" />
The only other part that makes this work is the creation of entries under Custom1 in the Building Blocks Organizer. In Word 2010, this would show all the building blocks under the Custom1 category. In Word 2013, it shows the name of each building block briefly, and then all of them are removed and the list is empty:
The building blocks themselves all contain either a document property or document variable.
I have tried the following to resolve this but without success:
Ensured that they are still present by opening the template outside of Visual Studio; they are.
Upgraded the template to the 2013 dotx format.
Re-created the building blocks.
Re-created the entire dotx file, and then re-created the building blocks.
I also tried using other ribbon IDs, they are empty too (they do all have entries) but they display it differently:
There should be four entries there, they exist in my Normal.dotm. The last two controls there, for equations and content controls, do work, except the content control that is inserted displays similar behavior as the Autotext gallery:
I don't know what should be shown in this case but I doubt it's nothing.
Right now I'm assuming that this is just a broken feature in 2013 and will have to replace it with something else. Does anyone know anything to the contrary?
I don't think it is a broken feature, after some struggle, I did get to understand how to use it:
The gallery button in the "toolbar" of a newly added Building Block Gallery Content Control indeed seems empty at first, because it is set to list QuickParts. You have to change it in the properties of the control so that it lists the content of the AutoText Gallery instead (or any other Gallery of Building Blocks you'd like). To do so, either directly click on the Properties button in the Developper tab while the control is selected, or switch to Design Mode so that the Properties appears in the context menu (right-click on the control):
AutoText is "Insertion automatique" in French, the rest you can guess ;)
As far as I could find, it's just a broken feature. There's also a ridiculous memory leak the first time you do a Find and add fields during that find.

is it okay to use loadOverlay() in a restartless addon?

Firefox addon. I'm porting an existing addon to a restartless one. I have a panel with a lot of UI elements (mostly boxes/description and images) in it, and it is very convenient for me to define the panel elements in an XUL overlay file. I will have lots of bloated js code if I don't.
The panel element (parent) itself is created in code dynamically, and then I use loadOverlay, wait for the 'merged' event and then append the panel element's children from the overlayed document. I also make sure that the elements are cleaned up upon a remove.
However, using overlays will most probably won't pass an AMO review. And some of the reasons I think are :
In most cases overlay elements will cause problems while removing (eg: toolbar buttons remembering their positions etc.)
There are problems with attaching js/css files in an overlay file.
loadOverlay is buggy (496320, 330458)
And here are my inferences :
loadOverlay() API itself is not deprecated - in fact it is 'not frozen and may change later' - which means possibly it will be use-able in future.
The bug that a second overlay load fails, is not applicable in my case, as I don't initialize without an overlay merge.
Using static overlay for preference windows etc. is perfectly acceptable as of now.
The panel in my case behaves a lot like a preference window (which is brought up on demand and cleaned up upon addon removal)
I don't have any js/css attached to the overlay, nor any event listeners for the elements. The overlay is only used to define boxes and description text - nothing more.
So considering these, is it acceptable to use overlays and loadOverlay() for a restartless addon ? If not, is there an alternative ?
About overlays, by checking source code of restartless addon that extend existing addon (like ehh), I see the overlay.xul is auto merged with the existing addon's. So it shouldn't be a problem to use overlay.

Items in Plones TinyMCE content browser are overlayed in album view - how to tackle this?

I do not know if this is a bug or rather stems from any customizations. I would like to know how to tackle this problem:
If I click on "add image" or "Link" in Plone's "Content Browser" the default view mode is "Album". In this mode the items are layed above each other, i.e. after 4 items the next items do not seem to be put into a new column.
See the screenshot:
Plone version is 4.3.2. How can I fix this? Pointers (relevant files, parts of code) welcome.
I have seen this happen too, depending on what I did with styling and skins. TinyMCE uses a grid system for showing these images and this needs the columns.css file from plonetheme.sunburst. I only now realize that this actually already goes wrong in the way you describe when you use standard Plone 4.3.2 and choose the classic theme as skin.
Ah, but it only fails because there is a typo in the columns.css that is shipped with plonetheme.classic, which actually includes the grid css as well. You can customize this file in portal_skins and fix the error. The problem is a line that is meant as a comment.
Change this line:
The 16-column Deco Grid System.
into this line:
/* The 16-column Deco Grid System.

SugarCRM 6.2 - Adding a custom field in user profile

Yeah. As the title says, I am tasked with creating custom field in user profile, and sort of hit a wall on this one. It is a very small customisation, add a yearly_target field to user edit and detail view.
I was happy to stumble on this article to add a custom field in sugar.
Although it's a huge help, it seems to be missing one or 2 minor points.
To have the fields show in edit and detail views, one apparently needs to create and edits EditView.php and EditView.tpl and DetailView.php and DetailView.tpl, except I am not too sure where these files go. The yearly target field shows up in user list view, but not in edit/detail views. I tried custom/modules/Users , custom/modules/Users/ext , but changes made in the templates (static html changes) have no effect.
Anyone know where these files should go?
Thanks SO'ers!
They should go in the custom/modules/Users/ directory. Do make sure you change the references inside the EditView.php and DetailView.php files to reference the templates you have in the custom/modules/Users/ directory instead of the default ones in the modules/Users/ directory.