-
-
Couldn't load subscription status.
- Fork 532
Description
Eiventeleiron created Redmine issue ID 8767
This is also similar for all other Resource Types (weblink, static resource, etc).
When instantiating for example the MODx.page.UpdateResource JavaScript class, we are defining a config.url value, which is pointing to the connector. Well, the fact is that the value inside MODx.page.UpdateResource doesn't get used at all (this is not so obvious), instead it is using the config.url from MODx.panel.Resource, where it is set up AGAIN (by exactly the same way).
Well, we can't modify this value without modifying the MODx.page.UpdateResource itself (because the MODx.panel.Resource from inside MODx.page.UpdateResource), so no way of changing of the connector URL FROM THE CONTROLLER. Yes, I can setting the MODx.page.UpdateResource config.url (by this way for example:
MODx.load({
xtype: "modx-page-resource-update"
,url: "/my/connector/path/connector.php"
// something else
});
but this setting gets lost when instantiating the MODx.panel.Resource.
I suggest changing (for example)
manager/assets/modext/sections/resource/update.js:
,components: [{
xtype: config.panelXType || 'modx-panel-resource'
,renderTo: config.panelRenderTo || 'modx-panel-resource-div'
,resource: config.resource
,record: config.record || {}
,publish_document: config.publish_document
,access_permissions: config.access_permissions
,show_tvs: config.show_tvs
,mode: config.mode
}]
to
,components: [{
xtype: config.panelXType || 'modx-panel-resource'
,renderTo: config.panelRenderTo || 'modx-panel-resource-div'
,resource: config.resource
,record: config.record || {}
,publish_document: config.publish_document
,access_permissions: config.access_permissions
,show_tvs: config.show_tvs
,mode: config.mode
,url: config.url
}]
If needed I can provide a pull request with all required changes on Github. This will allow better control over connectors from the controllers of the resource classes.