XF 1.2 Major Upgrade Issue

WSWD

Well-known member
Hello all. Help please! :) Getting the following error and now nothing is working at all:

Uh oh, your upgrade to 1.2.0 has failed!

The following elements of the database are incorrect:

  • Column xf_forum.allowed_watch_notifications missing.
  • Column xf_forum.default_sort_order missing.
  • Column xf_forum.default_sort_direction missing.
This is likely caused by an add-on conflict. You may need to restore a backup, remove the offending add-on data from the database, and retry the upgrade. Contact support if you are not sure how to proceed.
 
And then you run into the problem of it not working. The CORRECT solution is that the developer should NEVER be using the xf_ prefix for ANY of his/her database table creations.

Correct, but it would be the ADD-ON that doesn't work...not the base forum software. That's what happens with almost every other piece of forum software I've ever used. The base forum software itself doesn't fail.
 
Never ran into the upgrade issue, so didn't know about it. Nobody should be using the xf_ prefix in their database routine that is not core software (read xenForo). Most of the authors that I use have their own (xengallery - Xen Media Gallery, sf - tenants spam utilities, dark - Post Ratings, etc).
It should actually be xf_prefix_resource.

And then you run into the problem of it not working. The CORRECT solution is that the developer should NEVER be using the xf_ prefix for ANY of his/her database table creations.
xf_prefix is proper for add-on developers. The xf_* groups every table related to XenForo in the database.

And you're trying to tell me that XenForo can't compare tables with a base and return them to their original form if they have been altered? Tables that are added make absolutely no difference. Tables that are altered can be compared and fixed.
This type of situation can happen on every software I've ever used. Just because it hasn't happened to you doesn't mean it isn't possible in other software.
 
Why don't we start eliminating add-ons that probably caused this. My first guess would be the TMS, but since no one else has complained that's probably not the culprit. Same goes for Forums as Tabs. These would be my best guesses for culprits:

Prefix Forum Listing
Registration Form Timer
Require Thread Prefixes
 
This type of situation can happen on every software I've ever used. Just because it hasn't happened to you doesn't mean it isn't possible in other software.

Sorry, but that's just silly. Add-ons should never break a base install. The upgrade should simply overwrite anything the add-ons put there. And yes, it is possible with SQL.
 
It should actually be xf_prefix_resource.
xf_prefix is proper for add-on developers. The xf_* groups every table related to XenForo in the database.
It's actually done as both - but I prefer the non-xf prefix as it makes it a LOT easier to spot them - as you can see by the attached images (the majority of which use their OWN table names).
screenshot.webp screenshot1.webp
 
There is no forced standard here, it would be unenforceable. I believe I've seen it around here that its preferred to be xf_prefix_* to group everything together.
I know... and what I'm relaying is my personal preference. It makes it a lot easier (and less error prone) for ME if they aren't prefixed. I have been know (when tired) in the past to accidentally drop the wrong table because I highlighted the wrong xf_ prefixed one. The non xf_ prefixed ones make that a little less likely.
 
Looks like it's the require prefixes add-on (http://xenforo.com/community/resources/require-thread-prefixes.500/), at least at my guess.

As such, run this query:
Code:
ALTER TABLE xf_forum DROP require_prefix;
That should successfully drop a column. Then run this query:
Code:
ALTER TABLE xf_forum
ADD require_prefix TINYINT UNSIGNED NOT NULL DEFAULT '0',
ADD allowed_watch_notifications VARCHAR(10) NOT NULL DEFAULT 'all',
ADD default_sort_order VARCHAR(25) NOT NULL DEFAULT 'last_post_date',
ADD default_sort_direction VARCHAR(5) NOT NULL DEFAULT 'desc';
 
Looks like it's the require prefixes add-on (http://xenforo.com/community/resources/require-thread-prefixes.500/), at least at my guess.

As such, run this query:
Code:
ALTER TABLE xf_forum DROP require_prefix;
That should successfully drop a column. Then run this query:
Code:
ALTER TABLE xf_forum
ADD require_prefix TINYINT UNSIGNED NOT NULL DEFAULT '0',
ADD allowed_watch_notifications VARCHAR(10) NOT NULL DEFAULT 'all',
ADD default_sort_order VARCHAR(25) NOT NULL DEFAULT 'last_post_date',
ADD default_sort_direction VARCHAR(5) NOT NULL DEFAULT 'desc';


May I ask as to why you think that? There is nothing that indicates that my mod is at fault from what I saw. Also if the OP uninstalled it the custom column is dropped automatically.

And according to the OP, other columns are mentioned as causing the issue:


Hello all. Help please! :) Getting the following error and now nothing is working at all:

Uh oh, your upgrade to 1.2.0 has failed!

The following elements of the database are incorrect:

  • Column xf_forum.allowed_watch_notifications missing.
  • Column xf_forum.default_sort_order missing.
  • Column xf_forum.default_sort_direction missing.
This is likely caused by an add-on conflict. You may need to restore a backup, remove the offending add-on data from the database, and retry the upgrade. Contact support if you are not sure how to proceed.
 
May I ask as to why you think that? There is nothing that indicates that my mod is at fault from what I saw. Also if the OP uninstalled it the custom column is dropped automatically.
Because your add-on has a column that's the same as ours (I'm presuming). The other columns are missing because that query failed because of the column conflict.
 
Because your add-on has a column that's the same as ours (I'm presuming). The other columns are missing because that query failed because of the column conflict.

Thanks for the reply. But the column in my mod is not prefaced with the xf_ so I don''t think it would conflict.

But to be sure, the OP can drop manually the custom column from my mod and re-assuming the upgrade should not be a problem then.
 
The column isn't prefixed - it's require_prefix in the xf_forum table. If the added column were prefixed, it wouldn't have this conflict. :)

If the column is dropped by your add-on on uninstallation, then it should really be uninstalled before upgrading. (As if you fixed with the manual queries and then uninstalled, it's going to drop the now-standard XF column.)
 
The column isn't prefixed - it's require_prefix in the xf_forum table. If the added column were prefixed, it wouldn't have this conflict. :)

If the column is dropped by your add-on on uninstallation, then it should really be uninstalled before upgrading. (As if you fixed with the manual queries and then uninstalled, it's going to drop the now-standard XF column.)

Sorry for the confusion Mike and thank you for the clarification. I thought that the xenforo column was prefaced with prefix, i.e. xf_require_prefix. Hence why I thought that it should not cause a problem since my column is without xf_ prefix.
 
Just noticed that Template Modification System was installed. This definitely needs removed prior to upgrade. I had 4 failed upgrades before realising it was causing issues and that was with all add ons disabled. Once I uninstalled TMS prior to upgrade then everything worked fine. It may just be coincidental of course but even the author of that add on Im sure said somewhere to remove it prior to upgrading.
 
Like I said, never had it happen with any other software. The core forum software normally just overwrites anything the add-ons changed, and then the add-on simply doesn't work. It's never the other way around.

@Tracy Perry It's easy to fix. The forum software simply overwrites any database entries that were made by 3rd parties.
That is entirely possible by dropping tables and columns as part of the upgrade script.

Of course, when you then uninstall the add-on which drops those very same tables or columns then your installation is borked and you have potentially lost data (unless you have a current backup).

This method ensures the problem is dealt with at upgrade time and avoids any bigger problems later on.
 
Top Bottom