In Plone, inlined content does not update on document when published - inline

I have documents in my Plone CMS with content inlined from other objects. Once the document is published to my site the date and time it was last published (ie. last updated) is displayed at the bottom of the page template.
The problem I'm having is that When I re-publish the object from which content is inlined, the changes made to the content displays fine on the document, but the last updated date and time stays the same.
Obviously re-publishing the document itself will update last updated, but i'm wondering why last updated does not update itself automatically when the other object (where content is inlined from) is re-published.
The documents also link to other objects, when these other objects are altered and re-published, the date and time automatically update, without having to re-publish the actual document.

The last modification date is based on the object itself. Plone cannot automatically detect that you inline some other object's content.
If you "inline" the other objects's content with a simple iframe or so, you're out of luck.
If you wrote your own content type that grabs some other objects's content programmatically: yes, you can fix it. You'll have to register an event handler that listens to the other object's modification event.
Alternatively, you could write a script that goes through all your content-that-could-have-an-inline, find the content it inlines and updates the modification date if needed.

Related

How do I get access to current edited entity data like id and guid in modal window of 2sxc DNN module?

I'm writing my custom property type for module 2sxc. I mean I'd added a js file inside my app at path "/system/field-string-my-custom-field/index.js" and I'm writing my code there.
And I need to get id (or guid) and entity type of a current edited/created entity in modal window. I didn't find neither id, nor guid of that entity. The only place I've noticed in the html inside iframe that could tell type of entity is title on top of modal window, but that's also not good to take it from there, since it's actually a label, not the name of the entity, which might be different from the actual entity name. When I checked the code that is executed on submit button click - it has object formBuilderRef, which contains all the listed data I need (current entity's id, guid, type). But I didn't succeed in accessing it from my code for now.
Additional info:
I'm creating a custom property like this one. So on editing entity with my custom property type there's this modal window. Modal image is from internet but it should be enough to get an idea.
iframe's src property contains EntityId, but it looks like a bad place to take id from, since it contains an id of the entity used to open modal window of 2sxc module, but I could go to app settings and start editing totally different entity that is not on a current page at all. So I need an id of that currently edited entity and correct type, not a label.
So how do I get the data I need from there?
You can get them on
context.target.entity.id and context.target.entity.guid
see also: https://docs.2sxc.org/js-code/edit-form/formulas/context.html
while developing formulas, it's best to also watch the console, because on test-runs it will output all relevant objects data and context to the console.

Big-Calander Events not loading in custom view

I've mixed a couple of examples (CustomView, Moment JS localization) in order to create a view that only shows each Wednesday and Thursday. However, the events are not displayed.
The events are transferred from the parent to the child component (including the Calendar component). However, simply hardcoding events also does not work.
I feel like it's a problem within the custom view, but I cannot find what exactly.
See codesandbox.
The first thing I notice, looking at your codesandbox, is that you forgot to include the stylesheet. This is mentioned in the Getting Started section of the documentation. Your min and max props are being passed moment objects, rather than true js Date objects. And the hardcoded event date you included wasn't in the displayed date range.

Kendo UI DataSource toJSON is behind by a value

I have an angular application where I am trying to create batch editing in a Kendo Grid. I am manually adding data to the grid, so not using the datasource's transport mechanism, but rather just calling the .data() on the datasource.
When I edit a cell it correctly fires the save event, which also passes the modified data item, however when I call .toJSON() in order to get the raw data of the model, the output of .toJSON() seems to be different from the output of the model itself. It is as if the .toJSON() is behind by an iteration because when I edit the cell again it's the previous value I get.
An example of it can be seen here: http://dojo.telerik.com/ujiSu/5
Try to edit the product name, then in the console you can see the output of model and the output of model.toJSON()
I have tried calling .read() on the datasource before .toJSON() but that results in the datasource being emptied for some reason.
I have also been looking at the dirty property of the model data, forcing it's dirty state to change, but also without any different results.
My goal is to get the raw current data which is displayed in the grid and the datasource.
Any help with this is much appreciated.
In the save event of the grid, the model has not yet been updated. It will be updated by the grid(i.e. pushed into the grid's dataSource) after the save event. This is because the save event is cancel-able via e.preventDefault().
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-save
So, e.model contains the current state of the dataSource item and e.values contains the updated fields until after the save completes, at which point the values in e.values are pushed into the dataSource model.
You either need to combine e.values with e.model in the grid save event or you may want to instead look at the DataSource change event http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-change where the action is "itemchange" as that will occur after the grid save event(as long as you haven't cancelled it).

BreezeJS Entity keeps getting refreshed?

I have a page with two panels. The first panel is where create and update happens, and the second panel is a list of stuff that I just added. Sort of like this (below). The second panel updates the list every X second.
Each list has an edit button that takes it back to the first panel. I pass the entity through the button's function and fill up the values in the edit panel. Here's the weird thing, when I try like say edit an entity in the list, an the interval happens to update the list, the entity gets refreshed and all my changes are never saved.
I tried just passing the id though the button then doing a get request for that particular entity and performing the edit, but the interval takes place and my changes are reverted.
I think my only option is to do angular.copy(myEntity) and do the edits from there, and then manually do the PUT request. Is there another way for the edited entity not to be affected by the interval aside from doing an angular.copy()? Pausing the interval while something is being edited is not an option, since client wants the list to update even when he's editing something.
If you need to keep your data up to date by refreshing every few seconds, i recommend implementing a bool HasChanges() function in your controller. This will return true if the data has changed, and false if not. That way you can decide if you want to pull and refresh new data, or deffer it until your editing is done without overwriting your unsaved changes.

Updating Rowediting editor after a user Input

We have a rowediting plugin on grid where a button of one trigger field changes some other values of the record (we are loading some remote data which get applied to the record). The values that get changed in background are most commonly not editable, so they are just rendered. Basically the remote loading of the data works fine, meaning the record get changed and all data get save but we have the following problems:
1.The rowediting plugin does not show the changes that where applied to the record fields
2.Setting the changes via record.set() cause the store to sync immediately and not on clicking the "save" button of the editor.
So how can we make the editor to show the changes applied in the background and how can we apply these changes in a way so that they get saved along with the other edited fields.
Thanks in advance for any help!
This should not be that complicated, you just need a reference to your active editor instance. You can then either
reload the record into the form by calling loadRecord() again. But note that this may overwrite any changes that where made by now within the editor
or (for the second way I expecting the values to be exactly the same as in the record in manner of key:value definition - short: no special mapping is required)
apply the new data to the record by calling either set (note that this will trigger sync if you have autoSync turned on) or by using Ext.apply(recinstance.data,newvalues) and editorinstance.getForm().setValues(newValues)

Resources