Undefined index: desclength - prestashop

I got this notice in Prestashop 1.6.1.0 Stats>Catalog Evaluation.
Notice: Undefined index: desclength_zh in /var/www/1cdeli.com.cn/public_html/modules/statscheckup/statscheckup.php on line 259
Notice: Undefined index: desclength_en in /var/www/1cdeli.com.cn/public_html/modules/statscheckup/statscheckup.php on line 259
I had same issue before updating from 1.6.0.14.

Control you have the same of latest version module, like this :
foreach ($descriptions as $description)
{
if (isset($description['iso_code']) && isset($description['description']))
$row['desclength_'.$description['iso_code']] = Tools::strlen(strip_tags($description['description']));
if (isset($description['iso_code']))
{
$scores['description_'.$description['iso_code']] = ($row['desclength_'.$description['iso_code']] < Configuration::get('CHECKUP_DESCRIPTIONS_LT') ? 0 : ($row['desclength_'.$description['iso_code']] > Configuration::get('CHECKUP_DESCRIPTIONS_GT') ? 2 : 1));
$totals['description_'.$description['iso_code']] += $scores['description_'.$description['iso_code']];
}
}
Module Git: https://github.com/PrestaShop/statscheckup/blob/master/statscheckup.php

Related

Getting duplicate functions inside built self created react module

So I have a react component that I'm trying to publish into npm registry.
It is a simple component, that decides what component to render, and all the options to render are created by others in my corporation and imported from npm registry.
The problem is, that when I build my component, and try to use it, it does not work and gives me the next error:
./node_modules/#corp/foo/dist/component.es.js
SyntaxError: /Users/225336/Documents/corp/projektit/react-test-
app/test-app/node_modules/#corp/component/dist/component.es.js: Identifier
'___$insertStyle' has already been declared (86:9)
84 | }
85 |
> 86 | function ___$insertStyle(css) {
| ^
When I look into component.es.js, I see that it creates ___$insertStyle(css) function, for every imported component and one for my parent component, but the first two does not have identification numbers after them and so they overlap
function ___$insertStyle(css) {
if (!css) {
return;
}
if (typeof window === 'undefined') {
return;
}
var style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML = css;
document.head.appendChild(style);
return css;
}
...
function ___$insertStyle(css) {
if (!css) {
return;
}
if (typeof window === 'undefined') {
return;
}
var style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML = css;
document.head.appendChild(style);
return css;
}
___$insertStyle(".1-embed-container...");
...
function ___$insertStyle$1(css) {
...
}
...
___$insertStyle$1(".2-embed-container...");
...
function ___$insertStyle$2(css) {
...
}
...
___$insertStyle$2(".at-embed{padding:14px;line-height:1.4;font-family:Bernino Sans,Verdana,sans-serif}.at-embed div{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.at-embed h4{margin:0 0 5px}.at-embed h6{margin:0;font-size:13px;font-weight:700}.at-embed img{display:none}.at-embed article{border-left:4px solid #999;padding:2px 0 2px 10px;margin-bottom:10px;clear:both}.at-embed article,.at-embed article:first-child{-webkit-flex:1 0 100%;-ms-flex:1 0 100%;flex:1 0 100%;margin-right:20px}.at-embed article:first-child{margin-bottom:20px;border:0;padding:0}.at-embed article:first-child a{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}.at-embed article:first-child h6{font-size:15px;line-height:1.2}.at-embed article:first-child img{display:block;margin-right:14px;width:40%}.at-embed article:last-child{margin:0}#media (min-width:420px){.at-embed article:first-child h6{font-size:18px}}#media (min-width:840px){.at-embed article{-webkit-flex:1 1 135px;-ms-flex:1 1 135px;flex:1 1 135px;border:0;padding:0}.at-embed article img{display:block;margin:0 0 10px}.at-embed article:first-child h6{font-size:22px}}.at-embed-kl article{border-color:#00c4e0}.at-embed-te article{border-color:#eb1c22}.at-embed-mb article{border-color:#4068ad}.at-embed-mb svg path{fill:#4068ad}");
...
What could cause it and how could i fix it?🤔
Removing manually one of the duplicate functions fixes the problem, but that isn't obviously the right way.
"Fixed" it by using webpack instead of rollup.

Errors after migration to PHP7

I am seeing the following error after migrating to PHP7 from PHP5
PHP Notice: Array to string conversion in /data/get.php on line 25
PHP Notice: Undefined property: stdClass::$Array in /data/get.php on line 25
PHP Notice: Trying to get property 'file' of non-object in /data/get.php on line 25
PHP Warning: include(): Filename cannot be empty in /data/get.php on line 25
PHP Warning: include(): Failed opening '' for inclusion ( include_path='.:/apps/php-7.2.9/lib/php') in /data/get.php on line 25
Following the are lines of code
` $arr_no_security = array("casestudy","homesharepins", "videotour", "questionengine","casestudysplash");
$security_check = (!in_array($_GET['section'],$arr_no_security));
require_once('includes/app.php');
if(!Security::is_error())
{
if (isset($_GET['section']))
{
include('sections/section.header.inc.php');
$bln_file_included = false;
foreach ($config->application_data->get as $section => $value)
{
if (strtolower($_GET['section']) == strtolower($section)) {
$bln_file_included = true;
include($config->application_data->get->$_GET['section']->file);
}
The last line is line no 25
Any suggestions to resolve this
$config->application_data->get->$_GET['section']->file
should be
$config->application_data->get->{$_GET['section']}->file
See: http://php.net/manual/en/migration70.incompatible.php
Section "Changes to variable handling"

Cant create new entry. PHPLDAPADMIN

I just installed LDAP and PHPLDAPADMIN.Its work fine but when I want Create new entry page just refresh and nothing happend.There are a few errors:
Unrecognized error number: 8192: Function create_function() is deprecated
Errors in phpldapadmin
Thank you.
Try this code working fine.
/usr/share/phpldapadmin/lib/functions.php on line 54
change line 54 to
function my_autoload($className) {
Add this code on line 777
spl_autoload_register("my_autoload");
change line 1083 to
$CACHE[$sortby] = __create_function('$a, $b',$code);
add the code below on line 1091 from the
function __create_function($arg, $body) {
static $cache = array();
static $maxCacheSize = 64;
static $sorter;
if ($sorter === NULL) {
$sorter = function($a, $b) {
if ($a->hits == $b->hits) {
return 0;
}
return ($a->hits < $b->hits) ? 1 : -1;
};
}
$crc = crc32($arg . "\\x00" . $body);
if (isset($cache[$crc])) {
++$cache[$crc][1];
return $cache[$crc][0];
}
if (sizeof($cache) >= $maxCacheSize) {
uasort($cache, $sorter);
array_pop($cache);
}
$cache[$crc] = array($cb = eval('return
function('.$arg.'){'.$body.'};'), 0);
return $cb;
}
finally restart your apache server sudo service apache2 restart
PhpLdapAdmin uses a few functions which are deprecated in PHP 7.2. Take a look at this fix:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890127

Puppet: Syntax error with '$x.each...'

I have the code below:
define keepalived::vrrp_instance(
$state,
$interface,
$virtual_addresses,
$virtual_router_id,
$priority = $::keepalived::params::priority,
$advert_int = $::keepalived::params::advert_int,
$password = $::keepalived::params::password,
$notify_master = $::keepalived::params::notify_master,
$notify_backup = $::keepalived::params::notify_backup,
$notify_fault = $::keepalived::params::notify_fault,
$notify_all = $::keepalived::params::notify_all,
$smtp_alert = $::keepalived::params::smtp_alert,
) {
...
$virtual_addresses.each |$address| {
$splitted_address = split($address,' ')
if !is_ip_address($splitted_address[0]) {
fail("Error virtual_address Value: \"${address}\" not an ip address!")
}
}
...
}
$virtual_addresses is something like ['127.0.0.1 dev eth0','fd00::1 dev eth0']
Running the code I get the following error:
Syntax error at '.'; expected '}' at /etc/puppet/environments/ip6_dev/modules_custom/keepalived/manifests/vrrp_instance.pp:136 on node
Line 136 is "$virtual_addresses.each |$address| {"
I can't find a mistake (https://docs.puppetlabs.com/references/3.stable/function.html#each)
I am using Puppet 3.3.2
"note requires parser = future"
Ensure you are using future parser in puppet.
Set parser = future in your puppet.conf file or add the command line switch --parser=future
UPDATE:
Wrap your verification function:
define verify::wrapper ()
{
$ip_address = split($name,' ')
if !is_ip_address("${ip_address[0]}") {
fail("Error virtual_address Value: \"${ip_address[0]}\" not an ip address!")
}
}
Next use it:
define keepalived::vrrp_instance(...)
{
...
verify::wrapper{ $virtual_addresses : }
...
}

Error in Opencart theme header

I am using ancart template for opencart. These errors are shown
Notice: Undefined variable: small_html in /home/rythm321/public_html/catalog/view/theme/ancart/template/common/header.tpl on line 113
Notice: Undefined variable: org_html in /home/rythm321/public_html/catalog/view/theme/ancart/template/common/header.tpl on line 137
Here is the header file https://www.dropbox.com/s/7heyayzwoewjmqt/header.tpl
Change:
if ($categories) {
$org_html = "";
$small_html = "";
To:
$org_html = "";
$small_html = "";
if ($categories) {
As the variables are defined within the if condition, they'll not get defined if the if condition returns false.
Have a nice day !!
you should select "Show in the top menu" from the category edit menu each other.