Skip to content

Commit 5d3b150

Browse files
author
Jelte Lagendijk
committed
Fix ticket 69994: Microflow Timer not working properly in popup. Also item ASC-2
1 parent 0be67b6 commit 5d3b150

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MicroflowTimer",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "",
55
"license": "",
66
"author": "",
@@ -34,4 +34,4 @@
3434
"folders": "node ./node_modules/gulp/bin/gulp folders",
3535
"modeler": "node ./node_modules/gulp/bin/gulp modeler"
3636
}
37-
}
37+
}

src/MicroflowTimer/widget/MicroflowTimer.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ define([
187187
var mfObject = {
188188
params: {
189189
actionname: this.microflow,
190-
origin: this.mxform,
191190
applyto: "selection",
192191
guids: [this._contextObj.getGuid()]
193192
},
@@ -202,6 +201,15 @@ define([
202201
mx.ui.error("An error ocurred while executing microflow" + error.message);
203202
})
204203
};
204+
205+
if (!mx.version || mx.version && parseInt(mx.version.split(".")[0]) < 6) {
206+
mfObject.store = {
207+
caller: this.mxform
208+
};
209+
} else {
210+
mfObject.origin = this.mxform;
211+
}
212+
205213
mx.data.action(mfObject, this);
206214
}
207215
},
@@ -228,41 +236,32 @@ define([
228236

229237
// Reset subscriptions.
230238
_resetSubscriptions: function() {
231-
// Release handles on previous object, if any.
232-
if (this._handles) {
233-
dojoArray.forEach(this._handles, function (handle) {
234-
this.unsubscribe(handle);
235-
});
236-
237-
this._handles = [];
238-
}
239+
this.unsubscribeAll();
239240

240241
// When a mendix object exists create subscribtions.
241242
if (this._contextObj && this.timerStatusAttr) {
242-
var _objectHandle = this.subscribe({
243+
this.subscribe({
243244
guid: this._contextObj.getGuid(),
244245
callback: lang.hitch(this, function(guid) {
245246
this._checkTimerStatus();
246247
})
247248
});
248249

249-
var _attrHandle = this.subscribe({
250+
this.subscribe({
250251
guid: this._contextObj.getGuid(),
251252
attr: this.timerStatusAttr,
252253
callback: lang.hitch(this, function(guid, attr, attrValue) {
253254
this._checkTimerStatus();
254255
})
255256
});
256257

257-
var _attrHandle2 = this.subscribe({
258+
this.subscribe({
258259
guid: this._contextObj.getGuid(),
259260
attr: this.intervalAttr,
260261
callback: lang.hitch(this, function(guid, attr, attrValue) {
261262
this._intervalChange();
262263
})
263264
});
264-
265-
this._handles = [_objectHandle, _attrHandle, _attrHandle2];
266265
}
267266
},
268267

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="MicroflowTimer" version="4.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="MicroflowTimer" version="4.0.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="MicroflowTimer/MicroflowTimer.xml"/>
66
</widgetFiles>

test/widgets/MicroflowTimer.mpk

-23 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)