Error when creating a marker

Phoca Maps - displaying maps in Joomla! CMS
p260953
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Jul 2023, 13:19

Error when creating a marker

Post by p260953 »

I have just migrated my site to Joomla 4 and upgraded the old version of Phoca Maps to Joomla 4. Since I have over 100 markers, I wanted to avoid a clean reinstall. But now I have the problem that when I create new markers I get the following error message:
Save failed. Error: Field 'params' does not have a default value.
Probably there are problems with the database that certain fields do not exist or have wrong default values. How can I solve this without uninstalling and reinstalling?
Is there a way to edit the database?
Can I export the markers and import them again later?

Tags:
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9123
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Error when creating a marker

Post by Benno »

Hi,
Is there a way to edit the database?
Can I export the markers and import them again later?
See: https://www.phoca.cz/documentation/86-j ... o-joomla-4 Scroll down to Phoca Maps section.

Kind regards,
Benno
p260953
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Jul 2023, 13:19

Re: Error when creating a marker

Post by p260953 »

I understand the tip to copy the database from JEM 2.x to JEM 4, but would that solve my problem? Actually, the database is already there with all the previous markers and it works. Only new markers cannot be added. It comes to the described error message! Has the structure of the JEM database changed? If so, importing the old database would not help.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error when creating a marker

Post by Jan »

Hi, when you migrate based on the guide, then all columns get new format and such error does not occurr. If not then the column needs to be edited directly in the database.

Jan
If you find Phoca extensions useful, please support the project
p260953
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Jul 2023, 13:19

Re: Error when creating a marker

Post by p260953 »

Ok, which columns are new in the version for joomla 4? Are there any columns that change there format. If I know them I can add them manually to the database. Without this information. Sorry for my confusion!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error when creating a marker

Post by Jan »

Hi,

there are no new columns, but for some columns the type changed in Joomla 4, e.g.

Joomla 3 or 4:
`params` text (which in fact means text default null
Joomla 2.5:
`params` text NOT NULL,

So the params needs to be changed, try to run this SQL command in your e.g. phpMyAdmin (change the prefix _jos to yours):

ALTER TABLE `jos_phocamaps_map` CHANGE `params` `params` text;
ALTER TABLE `jos_phocamaps_marker` CHANGE `params` `params` text;
ALTER TABLE `jos_phocamaps_icon` CHANGE `params` `params` text;

Jan
If you find Phoca extensions useful, please support the project
p260953
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 14 Jul 2023, 13:19

Re: Error when creating a marker

Post by p260953 »

Thank you Jan ! It works !
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error when creating a marker

Post by Jan »

Great to hear it.

Jan
If you find Phoca extensions useful, please support the project
mikaelbjors
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 03 Aug 2018, 10:57

Re: Error when creating a marker

Post by mikaelbjors »

I have the same problem. But this solution didn't help because of another error when trying to run that SQL:

ALTER TABLE `sfro_phocamaps_map` CHANGE `params` `params` text;

MySQL said:
#1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'checked_out_time' at row 1
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error when creating a marker

Post by Jan »

Hi, where do you get this error: "#1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'checked_out_time' at row 1" in which action. When altering the table?

Did you follow the guide for the migration, so new tables and columns will be created?

Jan
If you find Phoca extensions useful, please support the project
Post Reply