Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer error: Undefined constant "DIR_FS_CATALOG" #5916

Closed
torvista opened this issue Aug 2, 2023 · 4 comments · Fixed by #5919
Closed

installer error: Undefined constant "DIR_FS_CATALOG" #5916

torvista opened this issue Aug 2, 2023 · 4 comments · Fixed by #5919

Comments

@torvista
Copy link
Member

torvista commented Aug 2, 2023

php 8.2.8, local, Windows
Using fileset v200 01/08/2023
New install/not regenerating configs, installing demo products.

Final screen that should show the shopfront and admin links, is a whitescreen with this error:

[02-Aug-2023 08:53:45 UTC] PHP Fatal error: Uncaught Error: Undefined constant "DIR_FS_CATALOG" in D:\GitHub\zencart\includes\classes\db\mysql\query_factory.php:677
Stack trace:
#0 D:\GitHub\zencart\includes\classes\db\mysql\query_factory.php(659): queryFactory->show_error()
#1 D:\GitHub\zencart\includes\classes\db\mysql\query_factory.php(299): queryFactory->set_error(1366, 'Incorrect strin...', true)
#2 D:\GitHub\zencart\zc_install\includes\classes\class.zcDatabaseInstaller.php(545): queryFactory->Execute('update configur...')
#3 D:\GitHub\zencart\zc_install\includes\modules\pages\completion\header_php.php(39): zcDatabaseInstaller->doCompletion(Array)
#4 D:\GitHub\zencart\zc_install\index.php(40): require('D:\GitHub\zenca...')
#5 {main}
thrown in D:\GitHub\zencart\includes\classes\db\mysql\query_factory.php on line 677

@drbyte
Copy link
Member

drbyte commented Aug 2, 2023

@torvista that line 545 is failing to set the settings you defined in your DEVELOPER_CONFIGS array, complaining about "incorrect string value" on something you gave it.

if (defined('DEVELOPER_MODE') && DEVELOPER_MODE === true && defined('DEVELOPER_CONFIGS') && is_array(DEVELOPER_CONFIGS)) {
foreach (DEVELOPER_CONFIGS as $key => $value) {
if (null === $value) continue;
$sql = "update " . $this->dbPrefix . "configuration set configuration_value = '" . $this->db->prepareInput($value) . "' where configuration_key = '" . $this->db->prepareInput($key) . "'";
$this->db->Execute($sql);
}
}

What's in that array, in your custom dev files?

drbyte added a commit to drbyte/zencart that referenced this issue Aug 2, 2023
@drbyte
Copy link
Member

drbyte commented Aug 2, 2023

While the PR I've linked will fix the "undefined constant" error, it will not fix the fact that whatever you're trying to insert as dev settings is triggering db query failures

@drbyte drbyte linked a pull request Aug 3, 2023 that will close this issue
@torvista
Copy link
Member Author

torvista commented Aug 4, 2023

One item in define('DEVELOPER_CONFIGS',
is 'STORE_NAME_ADDRESS'.

Long ago when I was first flagging up problems I found due to mis-handling of multibyte/accented characters, I made a habit of always including a series of them (áéíóúñ) in the store address and other places to highlight such problems.

My reference/dev copy of localConfig.php is encoded in utf-8 for these characters.
I copied/merged my edits into the core localConfig which is ANSI.
So the installer choked on these characters until the file was re-encoded in utf-8.

@scottcwilson
Copy link
Sponsor Contributor

Thanks for doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants