SP Property 4.1.4 – Unique ID and Database Structure Issues - Forum | JoomShaper
Solved Extensions Joomla 6 v6.2.0

SP Property 4.1.4 – Unique ID and Database Structure Issues

Asked by thanhhx57 6 days ago Last activity 5 days ago

Hi JoomShaper Team,

I'm using SP Property 4.1.4 with Joomla 6.2.0 and have encountered two issues:

1. Unique ID auto-generation error

When adding a property with a Vietnamese title and leaving Unique ID empty, saving fails with:

Incorrect string value: '\xC326103...' for column 'property_id' at row 1

Manually entering an ID like #0009 works fine.

Suggestion: Please use auto-generated sequential numeric IDs (e.g., #00001, #00002) instead of generating IDs from property titles to avoid character encoding issues.

2. Database structure errors

Joomla's Database Maintenance reports two issues in #__spproperty_properties.

Clicking Update Structure does not resolve these errors.

Please review the database schema and update scripts for Joomla 6 compatibility.

Screenshots:

https://prnt.sc/AwipXPPZfhbC

https://prnt.sc/JvoyWeJW01PV

https://prnt.sc/372O3UgxdTRR

https://prnt.sc/vSO7zrdiTEO4

https://prnt.sc/ifwbcEGhTsG7

I hope these issues can be fixed in the next update.

Thank you for your support!

Accepted answer

Marked as the solution
Ziaul Kabir Staff

Hello,

I've fixed both issues. I've shared an Akeeba backup zip in the hidden content section. Please restore it on a staging site first and check that everything works before you do anything on your live site.

How to restore the Akeeba ZIP backup on a staging site

The backup is a standard .zip that contains the site files and an installation folder, so you don't need any extra tools.

  1. Download the backup zip from the hidden content section.
  2. On your staging server, create an empty folder or subdomain, and an empty MySQL database with its own user.
  3. Upload the zip to the staging web root and extract it. In cPanel, use File Manager → Extract. You can also extract it on your computer and upload the files by FTP.
  4. Open https://your-staging-site/installation/index.php in your browser. This starts the Akeeba restoration script.
  5. Enter the staging database host, name, username and password, then continue through the steps. Leave the table prefix as it is.
  6. When it finishes, click Clean up, or delete the installation folder manually.
  7. Log in to /administrator and go to System → Maintenance → Database. SP Property should show no problems.
  8. Add a test property with a Vietnamese title and leave Unique ID empty. It should save with an ID like #00001.

When it all looks fine, repeat the same steps on your live site. Back up the live site first.

Alternative: apply the fix manually

Here is what I changed. All paths are relative to your Joomla root.

Fix 1: Unique ID error with Vietnamese titles

The ID was built from substr() of the title. That cuts multi-byte characters in half and produces invalid UTF-8.

In administrator/components/com_spproperty/helpers/spproperty.php, replace the generateID() function with:

public static function generateID($title = '', $date = null)
{
    $db    = Factory::getDbo();
    $query = $db->getQuery(true)
        ->select('MAX(' . $db->qn('id') . ')')
        ->from($db->qn('#__spproperty_properties'));
    $db->setQuery($query);
    $next = (int) $db->loadResult() + 1;

    do {
        $id    = '#' . str_pad((string) $next++, 5, '0', STR_PAD_LEFT);
        $query = $db->getQuery(true)
            ->select('COUNT(*)')
            ->from($db->qn('#__spproperty_properties'))
            ->where($db->qn('property_id') . ' = ' . $db->q($id));
        $db->setQuery($query);
    } while ((int) $db->loadResult() > 0);

    return $id;
}

IDs are now sequential (#00001, #00002, …) and no longer depend on the title.

Fix 2: Database structure errors

The checker compares your table with the extension's SQL files. The files described alias as VARCHAR(55) and price as float(8,2), which doesn't match a real database. float(8,2) also can't store large values such as VND prices. Edit these three files:

  1. administrator/components/com_spproperty/sql/updates/mysql/2.0-2018-07-30.sql

    • Find this line (line 11):
      ALTER TABLE `#__spproperty_properties` CHANGE `slug` `alias` VARCHAR(55) NOT NULL DEFAULT '';
    • Change it to:
      ALTER TABLE `#__spproperty_properties` CHANGE `slug` `alias` VARCHAR(255) NOT NULL;
    • Change only this #__spproperty_properties line. The similar lines for agents, categories and propertyfeatures stay as they are.
  2. administrator/components/com_spproperty/sql/updates/mysql/4.0.0.sql

    • Find this line (line 2):
      ALTER TABLE `#__spproperty_properties` MODIFY `price` float(8,2) NOT NULL DEFAULT '0.00';
    • Change it to:
      ALTER TABLE `#__spproperty_properties` MODIFY `price` decimal(18,2) NOT NULL DEFAULT '0.00';
  3. administrator/components/com_spproperty/sql/install/mysql/install.sql

    • In the CREATE TABLE IF NOT EXISTS#__spproperty_properties`` block, change:
      `alias` varchar(55) NOT NULL DEFAULT '',

      to:

      `alias` varchar(255) NOT NULL,
    • In the same block, change:
      `price` float(8,2) NOT NULL DEFAULT '0.00',

      to:

      `price` decimal(18,2) NOT NULL DEFAULT '0.00',

If your database still has alias VARCHAR(55) or price float(8,2), run this in phpMyAdmin first. Replace PREFIX_ with your table prefix:

ALTER TABLE `PREFIX_spproperty_properties` MODIFY `alias` VARCHAR(255) NOT NULL;
ALTER TABLE `PREFIX_spproperty_properties` MODIFY `price` DECIMAL(18,2) NOT NULL DEFAULT '0.00';

Then open System → Maintenance → Database and the errors should be gone.

Updating or reinstalling SP Property from the official package will overwrite these edits. In that case, reapply them or wait for an official release that includes the fix.

Best regards

3 more replies

Ziaul Kabir Staff

Hi,

Thank you for the detailed report. We tested both issues using SP Property 4.1.4 with Joomla 6.2.0.

1. Unique ID Error with Vietnamese Titles

We were able to reproduce this issue. When the Unique ID field is left empty, SP Property automatically generates an ID using the first three characters of the title. However, the current code counts bytes rather than characters. Since Vietnamese characters can occupy two or three bytes, the process may cut a character in the middle, resulting in invalid text that MySQL rejects.

This explains the error you encountered: Incorrect string value: '\xC3...'.

The issue affects only titles where the character truncation occurs in this way. For example, titles such as “Đất nền” or “Nhà phố” may trigger the error, while other Vietnamese titles may save successfully.

As a temporary workaround, you can manually enter a Unique ID, such as #0009, instead of leaving the field empty. We have reported this issue to our development team, and a fix is being worked on.

2. Database Structure Errors

We were unable to reproduce this issue on our test site. When we ran Joomla’s database check, SP Property reported no database structure problems. This suggests that the issue may be specific to your site's database configuration or structure.

If the issue persists, we can investigate and fix it directly on your site. To proceed, we would need the following access details, which you can provide through the hidden content section:

  • Joomla administrator access
  • phpMyAdmin or equivalent database access

Before sharing access, please make sure to take a full backup of your website files and database. Once the issue has been resolved, you can change the passwords or revoke the access provided.

Thank you again for reporting these issues and helping us improve SP Property.

Best regards,

thanhhx57 Asked this

Hi,

Thank you for your prompt response and for looking into these issues.

I have provided both the Joomla administrator login details and phpMyAdmin access credentials through the hidden content section.

Please check and help me resolve the database structure issue.

Thank you again for your support!

Best regards.

thanhhx57 Asked this

Hi,

Thank you so much for your excellent support and detailed instructions!

I successfully applied Option 2 (manual fixes), and both issues have been completely resolved. Everything is now working perfectly.

I really appreciate your prompt response and professional assistance.

I'm looking forward to the next official update of SP Property, and I hope these fixes will be included in the upcoming release.

Thanks again for your great support. You can now close this ticket.

Best regards!

Ziaul Kabir Staff

It’s great to hear that your issue has been resolved.
If everything is working fine now, please mark the question as complete by accepting any of our answers.

Thank you!

Log in to reply.