Tabulator 5 - paginationDataSentNames replacement? - tabulator

I am upgrading Tabulator from 4.9 to 5.2 and tried replacing:
Tabulator.prototype.extendModule("page", "paginationDataSentNames", {
"sorters":"org.kawa.template.tabulator.sorters",
});
... with:
Tabulator.extendModule("page", "dataSendParams", {
"sorters":"org.kawa.template.tabulator.sorters",
});
... but getting following error:
Module Error - property does not exist: dataSendParams
t.extendModule # ModuleBinder.js:31
Could anyone help here?

Related

NodeJS - Sequelize - Stored Procedure - is not working

I am trying do find what is the problem with my code below, I am using the plugin Tedious (SQL Server), sequelize and NodeJs:
exports.getCreditsGeneral = function(sgecode) {
return sequelize.query('[dbo].[SP_ListaCreditos](:sgecode1)',
{ replacements:{sgecode1: sgecode}})
.then(total => {
return total.length ? total : 0
})
}
Can someone help me please?
Thanks.
you are missing exec parameter
exports.getCreditsGeneral = function(sgecode) {
return sequelize.query('exec [dbo].[SP_ListaCreditos](:sgecode1)',
{ replacements:{sgecode1: sgecode}})
.then(total => {
return total.length ? total : 0
})
}

While extending PLP component, I get null value

When I extend a module and write code like below the plp variable is null, any idea why?
If I replace by PDP instead of PLP, I get value in variable.
return {
mountToApp: function mountToApp (container)
{
var plp = container.getComponent('PLP');
if(plp){
plp.addChildViews(
PLP.PLP_VIEW,
{
'GlobalViews.StarRating': {
'GlobalViews.StarRating': {
childViewIndex: 10
, childViewConstructor: function ()
{
return new FacetsExtension({
categoryInternalId: FacetsModel.get('category')? FacetsModel.get('category').get('internalid'):""
, application: this.application
});
}
}
}
}
);
What SuiteCommerce Version you are using? Please take note that PLP component is not available from killimanjaro and below versions. It only works on that latest version right now which is Aconcagua.

swift 3, NSFetchRequestResult has no member value

In Swift 2, I had used the following code:
for (_, value) in self.frc.fetchedObjects!.enumerated() {
if (value.value(forKeyPath: "name_of_field_of_entity_name") as? String == "S") {
...
}
}
Now, using Xcode 8.0 beta (8S128d) and Swift 3, Xcode tell me:
Value of type 'NSFetchRequestResult' has no member 'value'
How can fix this error?
Thank you
I solved on different way.
Instead of using loop with enumerated(), I created an array of objects and I access to XXX attribute by:
let xxx = self.frc.fetchedObjects as! [XXX]
for i in 0..<(xxx.count) {
print(xxx[i].attribute_of_XXX)
}

Defining and calling function in puppet 2.6 and 2.7

I have a module core and a class core::logrotate defined in core/manifests/logrotate.pp.
class core::logrotate {
#...some stuff here
#
define confd ($ensure = "present" , $log_name = "dummy" ) {
if ( $ensure == present )
{
file {
"/etc/logrotate.d/$log_name":
ensure => present,
source => filelookup("core/${log_name}.logrotate"),
}
} else {
file {
"/etc/logrotate.d/$log_name":
ensure => absent,
}
}
}
}
calling this function inside of templates.pp as
core::logrotate::confd { "mkill": log_name => mkill }
This fails with the error
Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type core::logrotate::confd
If the puppet master version is 2.6.x then this fails, to make it work there used to be a import "*" in the init.pp of the module. Now removed this as moving to puppet 2.7.20.
The code pasted here works in 2.7 but fails in 2.6. Any idea why? how can I make it work for both 2.6 and 2.7?
You should take the define outside of the class, see the style guide: http://docs.puppetlabs.com/guides/style_guide.html#classes
Also, I think that you might be using modules wrong, it would be much more logical to have a 'logrotate' module on its own.
So; in modulepath/logrotate/manifests/confd.pp you'd put this:
define logrotate::confd ($ensure = "present" , $log_name = "dummy" ) {
if ( $ensure == present )
{
file {
"/etc/logrotate.d/$log_name":
ensure => present,
source => filelookup("core/${log_name}.logrotate"),
}
} else {
file {
"/etc/logrotate.d/$log_name":
ensure => absent,
}
}
}
That should make it work properly.
Greetings,
Ger

Fatal error: Call to a member function isNew() on a non-object symfony 1.4

I am getting this fatal error when running a condition to see if this is a new record, and if so, create a duplicate draft record in the database.
actions.class.php
$this->form = new AlertsForm($active_alert);
if ($request->isMethod('post')) {
$this->form->bind($request->getParameter('alerts'), $request->getFiles('alerts'));
if ($this->form->isValid()) {
try {
/* check if record is the draft version, and if not create one */
if (!$active_alert->isNew() && !$active_alert['is_preview'] &&
($request->getParameter('button_type') != 'publish' ||
!$this->getUser()->hasPublishingPrivilege())) {
$active_alert = $active_alert->createDraft();
$values = $request->getParameter('alerts');
$values['id'] = $active_alert['id'];
$this->form = new AlertsForm($active_alert);
$this->form->bind($values, $request->getFiles('alerts'));
$this->getUser()->setFlash('draft', true);
}
Error:
Fatal error: Call to a member function isNew() on a non-object in apps/cms/modules/alerts/actions/actions.class.php on line 35
If I run a var_dump on $active_alert, it returns:
bool(false)
Older working versions of this piece of code are identical, so I am not sure it is this exact code that is wrong, I just do not know where to look.
The Fatal Error is because, as the error message suggests, there's no $active_alert, i.e. it is a non-object, and you're trying to call isNew() on a non-object.
What you can do is check for the existence of $active_alert before checking if it's (not) new:
if ($active_alert && !$active_alert->isNew() && !$active_alert['is_preview'] && ...

Resources