News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Enable customized smileys Error Line: 2990

Started by MrEd, October 07, 2012, 05:19:29 PM

Previous topic - Next topic

MrEd

Enable customized smileys checkbox and then saving produces this error-


ERROR: current transaction is aborted, commands ignored until end of transaction block
File: /smf/Sources/Subs.php
Line: 2990


code in that area


2983 }
2984
2985 $smcFunc['db_query']('', '
2986 UPDATE {db_prefix}log_activity
2987 SET' . substr($setStringUpdate, 0, -1) . '
2988 WHERE date = {date:current_date}',
2989 $update_parameters
2990 );
2991 if ($smcFunc['db_affected_rows']() == 0)
2992 {
2993 $smcFunc['db_insert']('ignore',
2994 '{db_prefix}log_activity',
2995 array_merge($insert_keys, array('date' => 'date')),
2996 array_merge($cache_stats, array($date)),
2997 array('date')
2998 );
2999 }





using
smf 202
postgre
php5

What's the next step?

emanuele

Hello MrEd,

I'm not a postgre expert, but googling a bit seems the error is in the "previous" query that returned an error...okay, so next step is find the previous query...

The strange thing is that this query is in trackStats, that means it's run on almost each and every page load...the possible interesting thing though is that the previous function is writeLog that doesn't always run his queries.

Do you get this error every time you try change this page? Did you try to repeat the save? Does the error popup only for that check box and any other setting in the page?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrEd

The error shows every time, on save of just that page option.

This is new to me, so be gentle :P

line number starts at 2954 and ends at 3002...sry I have to do the line numbers manually



2954     // Track Statistics.
     function trackStats($stats = array())
     {
      global $modSettings, $smcFunc;
      static $cache_stats = array();

      if (empty($modSettings['trackStats']))
return false;
if (!empty($stats))
return $cache_stats = array_merge($cache_stats, $stats);
elseif (empty($cache_stats))
return false;

$setStringUpdate = '';
$insert_keys = array();
$date = strftime('%Y-%m-%d', forum_time(false));
$update_parameters = array(
'current_date' => $date,
);
foreach ($cache_stats as $field => $change)
{
$setStringUpdate .= '
' . $field . ' = ' . ($change === '+' ? $field . ' + 1' : '{int:' . $field . '}') . ',';

if ($change === '+')
$cache_stats[$field] = 1;
else
$update_parameters[$field] = $change;
$insert_keys[$field] = 'int';
}

$smcFunc['db_query']('', '
UPDATE {db_prefix}log_activity
SET' . substr($setStringUpdate, 0, -1) . '
WHERE date = {date:current_date}',
$update_parameters
2990 );
if ($smcFunc['db_affected_rows']() == 0)
{
$smcFunc['db_insert']('ignore',
'{db_prefix}log_activity',
array_merge($insert_keys, array('date' => 'date')),
array_merge($cache_stats, array($date)),
array('date')
);
}

// Don't do this again.
3002 $cache_stats = array();






emanuele

Version of postgre and mysql? (just to be sure we are working on the same thing)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrEd

I did these so I guess it's 5 for both

# pkg_add -r php5

# pkg_add -r php5-extensions

# pkg_add -r php5-xmlrpc

# pkg_add -r php5-gettext

# pkg_add -r php5-mcrypt

# pkg_add -r php5-mbstring


Extensions need for MySQL


# pkg_add -r php5-pdo_mysql

# pkg_add -r php5-mysql


Extensions need for PostgreSQL


# pkg_add -r php5-pgsql

# pkg_add -r php5-pdo_pgsql


Extensions need for owncloud


# pcg_add -r php5-zip

# pkg_add -r php5-gd

Extension for forum emailing

# pkg_add -r php5-openssl

emanuele

I kind of doubt: postgre should be 8 or 9...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrEd

lol, duh me

aim:~# su pgsql
$ psql --version
psql (PostgreSQL) 9.0.10
contains support for command-line editing
$ aim:~#

emanuele

Okay, good I don't need to revive some old VM snapshot... O:)
My current config: php 5.3 and pg 9, I'll try again (first time I tried I didn't encounter any issue, but better be sure) later.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: