Questions on getting Xerte Toolkits installed on your server and questions about authentication and user logins.

Missing tables whilst trying to upgrade to v3.12.29

  • a511197
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #9043 by a511197
Hi Xerte developers,

Our Application Development Team encountered an error when applying 'function upgrade_36()' in the ‘upgrade.php’ on the new Xerte version 3.12 (v3.12.29) as our xerte DB does not have the tables below:

- oai_education and oai_categories

They are using a Bamboo deployment plan.

1). Can you amend the 'upgrade.php' with create table functions for oai_education and oai_categories tables? (We will then be able to update our DB patches as attached in the SQL script accordingly and continue the DEV Xerte upgrade from 3.10 to 3.12). [I can email you the file our Apps Dev team sent me]

2). For Future - In order to reduce the time taken in translating the upgrade.php to SQL script patches, Is there a way we can directly apply the upgrade.php to our servers?

I can email you the full email they sent me and attachments off forum.

many thanks,
Alison

If you can use Lego, you can use Xerte

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago - 2 years 2 months ago #9044 by tom
Oops. Thos tables are only created when oai-pmh harvesting is configured.

There should have been a check to see whther those tables do exist.

I fixed this in 3.12.30-6

You can patch upgrade.php in 2 ways:
1. Just remove or comment out the lines that at the parent_id to the two table in upgrade_36
2. Use the following instead of upgrade_36() and add function _table_exists:

[Code]

function upgrade_36(){
$table = table_by_key('oai_education');
$exists = _table_exists($table);
if ($exists) {
$ok = _upgrade_db_query("alter table $table add column parent_id int(11)");
$message = "Adding parent_id column to oai_education - ok ? " . ($ok ? 'true' : 'false') . "<br>";
}
$exists = _table_exists($table);
if ($exists) {
$table = table_by_key('oai_categories');
$ok = _upgrade_db_query("alter table $table add column parent_id int(11)");
$message .= "Adding parent_id column to oai_categories - ok ? " . ($ok ? 'true' : 'false') . "<br>";
}
$table = table_by_key('educationlevel');
$ok = _upgrade_db_query("alter table $table add column parent_id int(11)");
$message .= "Adding parent_id column to educationlevel - ok ? " . ($ok ? 'true' : 'false') . "<br>";
$table = table_by_key('syndicationcategories');
$ok = _upgrade_db_query("alter table $table add column parent_id int(11)");
$message .= "Adding parent_id column to syndicationcategories - ok ? " . ($ok ? 'true' : 'false') . "<br>";
return $message;
}

function _table_exists($table) {
$sql = "select 1 from $table limit 1";
$r = db_query($sql);
return $r!==false;
}

[\Code]
Last edit: 2 years 2 months ago by tom.
The following user(s) said Thank You: a511197

Please Log in or Create an account to join the conversation.

  • a511197
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 2 months ago #9051 by a511197
Many thanks Tom,
Didn't see your response until this morning. I'll pass that onto our software app team.
Alison

If you can use Lego, you can use Xerte

Please Log in or Create an account to join the conversation.

Time to create page: 0.121 seconds
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo