Postgresql mp_galleryimages_insert issue

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
5/20/2008 7:06:37 PM
Gravatar
Total Posts 20

Postgresql mp_galleryimages_insert issue

Hi, Joe.

I'm using mojoportal 2.2.5.4 packaged release and I'm facing this problem:

 

When trying to load a new image to immage gallery I received the fallowing message:

ERROR: 42883: function mp_galleryimages_insert(integer, integer, text, text, text, text, text, text, timestamp without time zone, text, character, character, character) does not exist

So, I looked the database and the function definition is:

create or replace function mp_galleryimages_insert
(
int, --:moduleid $1
int, --:displayorder $2
varchar(255), --:caption $3
text, --:description $4
text, --:metadataxml $5
varchar(100), --:imagefile $6
varchar(100), --:webimagefile $7
varchar(100), --:thumbnailfile $8
timestamp, --:uploaddate $9
varchar(100) --:uploaduser $10
) returns int4
 

So there are 3 parameters missing. I created 3 additional parameters of the same refered by the error message (character, character, character) then I checked the mp_galleryimages table structure  and found that there are 3 aditional columns. I put references to these columns at the insert statemant. The original error message was replaced by this:

 

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

 

I checked all scripts in the

web\Setup\applications\mojoportal-core\SchemaInstallScripts\pgsql
web\Setup\applications\mojoportal-core\SchemaUpgradeScripts\pgsql

directories and all definitions for the mp_galleryimages_insert are the 3 parameters missing...

 

Do you have any clue about solving this?

5/21/2008 4:53:58 AM
Gravatar
Total Posts 20

Re: Postgresql mp_galleryimages_insert issue

I waked up in the middle of the night with a dream.

 

I dreamed tha isn't the insert procedure that was raising this message, but the reading one.

 

So, I looked to the data stored in the database and there are 3 lines without values in the last 3 columns. I just delete then and the Image Gallery works perfectly, as usual in mojoportal.

 

So, it's solved, but there are missing parameters in the mp_galleryimages_insert function. Here is the code that I made to make it work:

 

CREATE OR REPLACE FUNCTION mp_galleryimages_insert(int4, int4, "varchar", text, text, "varchar", "varchar", "varchar", "timestamp", "varchar", "varchar", "varchar", "varchar")
RETURNS int4 AS
$BODY$
insert into mp_galleryimages
(
moduleid,
displayorder,
caption,
description,
metadataxml,
imagefile,
webimagefile,
thumbnailfile,
uploaddate,
uploaduser,
itemguid,
moduleguid,
userguid

)
values
(
$1,
$2,
$3,
$4,
$5,
$6,
$7,
$8,
$9,
$10,
$11,
$12,
$13

);
select cast(currval('mp_galleryimages_itemid_seq') as int4);; $BODY$
LANGUAGE 'sql' VOLATILE SECURITY DEFINER;
ALTER FUNCTION mp_galleryimages_insert(int4, int4, "varchar", text, text, "varchar", "varchar", "varchar", "timestamp", "varchar", "varchar", "varchar", "varchar") OWNER TO db2043a1;
GRANT EXECUTE ON FUNCTION mp_galleryimages_insert(int4, int4, "varchar", text, text, "varchar", "varchar", "varchar", "timestamp", "varchar", "varchar", "varchar", "varchar") TO public;
GRANT EXECUTE ON FUNCTION mp_galleryimages_insert(int4, int4, "varchar", text, text, "varchar", "varchar", "varchar", "timestamp", "varchar", "varchar", "varchar", "varchar") TO xxxyyyzzzkkk;
 

5/21/2008 8:15:49 AM
Gravatar
Total Posts 18439

Re: Postgresql mp_galleryimages_insert issue

I've made the fix for this here. It will be in svn trunk by tonight.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.