Error Page Displaying 500 An Error Occurred While Updating The Database. - Question | JoomShaper

Error Page Displaying 500 An Error Occurred While Updating The Database.

PD

Peter Dowse

SP Page Builder 1 year ago

Hi Guys,

Getting the following error message on error pages.

500 An error occurred while updating the database.

Any ideas?

Note - I've tried the database fix from here - https://www.joomshaper.com/forum/question/35140#qa-answer-176810 - this didn't work.

0
12 Answers
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 year ago #177105

Please, check your issues is resolved. https://marketeam.com.au/joomla5/services/web-design/website-asdasddevelopment marketeam.com.au/joomla5/asdasdasd

These all are going to show 404 Not Found.

Thanks,

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 year ago #176821

Hello Peter,

Thank you for reaching out to us. I sincerely apologize for the inconvenience.

I have disabled the System - Redirect plugin via System > Manage Extensions > Extensions. Could you please check now and let me know if the issue is resolved?

Best regards,

0
PD
Peter Dowse
Accepted Answer
1 year ago #176824

That has fixed it however, I need that plugin published as the redirect component is something we use heavily for SEO.

Is there another fix without having to turn off core functionality?

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 year ago #176830

You can update this code in the following paths, It will be resolved:

Possible cause: Due to keep new_url field is empty.

Paths: Root Joomla/plugins/system/redirect/src/Extension/Redirect.php on line 245

elseif ($redirect === null) {
            // No redirect object was found, so we create an entry in the redirect table
            if ((bool) $this->params->get('collect_urls', 1)) {
                if (!$this->params->get('includeUrl', 1)) {
                    $url = $urlRel;
                }

                $nowDate = Factory::getDate()->toSql();

                // Add a default value for new_url (can be set to a placeholder or actual value)
                $new_url = 'your-default-url';  // Replace with your actual default URL or logic

                $data = (object) [
                    'id'            => 0,
                    'old_url'       => $url,
                    'new_url'       => $new_url,  // Ensure new_url is included
                    'referer'       => $app->getInput()->server->getString('HTTP_REFERER', ''),
                    'hits'          => 1,
                    'published'     => 0,
                    'created_date'  => $nowDate,
                    'modified_date' => $nowDate,
                ];

                try {
                    $this->getDatabase()->insertObject('#__redirect_links', $data, 'id');
                } catch (\Exception $e) {
                    $event->setError(new \Exception($this->getApplication()->getLanguage()->_('PLG_SYSTEM_REDIRECT_ERROR_UPDATING_DATABASE'), 500, $e));
                    return;
                }
            }
        }

Note: After update joomla, It will gone. (When you redirect don't miss put new url.)

Thanks,

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 year ago #176832

First, Follow this sql command from : https://www.joomshaper.com/forum/question/35140#qa-answer-176810

your database table is zvdo_redirect_links

Thanks,

0
PD
Peter Dowse
Accepted Answer
1 year ago #176928

Hi Ziaul,

I've followed these instructios and am getting the following.

0 Unclosed '{' on line 34

See example. https://marketeam.com.au/joomla5/services/web-design/website-asdasddevelopment

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 year ago #176939

Hello,

Thanks for your replay. Please, give me your database and file access in hidden content section, So that I can investigate.

Thanks.

0
PD
Peter Dowse
Accepted Answer
1 year ago #176958

When you say file access - do you mean FTP access?

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 year ago #176965

Yes, You can give me FTP access and database access as well.

Thanks,

0
PD
Peter Dowse
Accepted Answer
1 year ago #177096

Please see hidden area.

0
PD
Peter Dowse
Accepted Answer
1 year ago #177229

Many thanks mate - that's got it.

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 1 year ago #177236

You are welcome.

0