I received the follow error message and cannot complete update.php now that I've got beta2 installed instead of alpha5.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tekals6_inmyradius.registration_state' doesn't exist: SELECT base.registration_state_id AS registration_state_id, base.name AS name, base.label AS label, base.description AS description, base.default_state AS default_state, base.active AS active, base.show_on_form AS show_on_form, base.weight AS weight, base.status AS status, base.module AS module FROM {registration_state} base WHERE (base.status IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2)) ; Array ( [:db_condition_placeholder_0] => 3 [:db_condition_placeholder_1] => 2 [:db_condition_placeholder_2] => 6 ) in EntityAPIController->query() (line 152 of /home/tekals6/public_html/inmyradius/sites/all/modules/entity/includes/entity.controller.inc).

It seems as if some new tables aren't being created. Any help would be appreciated.

This issue is affecting Registration Core, as it's the only module component that's currently active.

Comments

dpi’s picture

Status: Active » Closed (duplicate)
Po3t’s picture

I see. Thanks for the notice.

Po3t’s picture

Status: Closed (duplicate) » Active

Actually, I don't think this is a duplicate issue. It's not as simple as deleting the old module. I've deleted the old alpha module, ran the update script, cleared all caches, and then enabled the new module and ran the update script again. The error is still happening and the new database tables don't seem to be getting created.

What do I need to do?

Po3t’s picture

Status: Active » Closed (duplicate)

Never mind. Got it figured out. I didn't uninstall everything I needed to. Thanks.

Loube’s picture

Po3t,

I am trying to install the newer versions of Commerce Registrations and Entity Registrations. Would you be able to share with me what you uninstalled and how you did it, as well as how you installed the newer versions? I am still learning things like Git and I don't have experience altering databases. So any help you can give me would be very much appreciated.

Currently, I have Commerce Registrations 7.x-2.0-alpha5 and Entity Registrations 7.x-1.0-alpha4, and I want to install Commerce Registrations 7.x-2.0-beta1 and Entity Registrations 7.x-1.0-beta2. I have Drupal 7.14 installed.

Also, I have some commerce products that I have enabled for registrations. Do you know if I have to disable all of the registrations for those products? When I tried to disable the older Entity Registration the check box was grayed out because the message said 'Required by: Drupal (Field type(s) in use'. Or is the uninstall and new install process unrelated to that?

Thank you,
Loube

Po3t’s picture

Hi Loube,

I'm not sure if I can help you, as I am not a maintainer of this module. However, with that being said, I uninstalled the alpha version of this module by using the "Uninstall" link in the top right corner of the Modules page. You have to make sure that the module you want to uninstall is turned off (unchecked) and then it will appear in the "Uninstall" list. After I uninstalled the alpha version, I installed the beta version the normal way (by uploading the module to the "sites/all/modules" directory). Then I activated the module and everything was fine.

That being said, there was no upgrade path from alpha to beta, so if you were previously using the alpha version and you had content created from it, I'm not sure how you can transfer that over. You'll have to open a new ticket for that.

Cheers.

Loube’s picture

Po3t,

Thank you for your response and help. I now have the old version removed and the newer installed. I have existing products that seem to have carried over to the new version.

luketsimmons’s picture

Hi guys,

I had the same problem going to Beta1. I've modified my registration.install to accommodate an upgrade path as opposed to the defined re-install process that is required for Alpha5 to Beta1+ at the moment.

I'll create a proper patch, but essentially it requires a hook_update_N and we can create the `registration_state` table and add the indexes and column into the `registration` table.

I've added two updates, so that the `registration_state table` is created before adding the column and foreign key reference.

Anyway I may be getting ahead of myself with all this, but I'll post my install patch up and hopefully that'll help? The reason I had to investigate this further is because we have a lot of data in the registration table and so didn't want to risk dropping it all in order to re-create the tables with the adjusted schema. May have been OK, but I like the idea of a clean upgrade path :-)

Oh FYI, happy to open a new issue for the patch and reference this issue.

Thanks,
luke

luketsimmons’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new8.29 KB

Hi dpi/Loube/Po3t,

OK I've rolled a patch against registration beta3, have a look and let me know what you think?

It's just for the registration.install, and meaning that the module can be updated from Alpha5 to Beta1/2/3.

Let me know if there is anything wrong with the patch!

Thanks,
luke

int_ua’s picture

registration_uninstall() still needs fixing. Output after patching:

$ drush pm-uninstall registration
The following modules will be uninstalled: registration
Do you really want to continue? (y/n): y
WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '_d.d_registration_state' doesn't exist: DELETE[error]
FROM {registration_state} 
WHERE  (name IN  (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2)) ; Array
(
    [:db_condition_placeholder_0] => complete
    [:db_condition_placeholder_1] => pending
    [:db_condition_placeholder_2] => canceled
)
 in registration_uninstall() (line 375 of sites/all/modules/registration/registration.install).
Cannot modify header information - headers already sent by (output started at /usr/share/drush/includes/output.inc:37)                 [warning]
bootstrap.inc:1239
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '_d.d_registration_state' doesn't exist: DELETE FROM {registration_state} 
WHERE  (name IN  (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2)) ; Array
(
    [:db_condition_placeholder_0] => complete
    [:db_condition_placeholder_1] => pending
    [:db_condition_placeholder_2] => canceled
)
 в registration_uninstall() (рядок 375 із sites/all/modules/registration/registration.install).
Drush command terminated abnormally due to an unrecoverable error.                                                                     [error]
int_ua’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0-beta3
StatusFileSize
new8.46 KB

I've added the
if (db_table_exists('registration_state')) {
condition.

jpontani’s picture

A proper way to go about it would be to not bother deleting the row entries in the states table, as the states table is provided by registration_schema(), and is automatically deleted by Drupal upon uninstall, prior to running hook_uninstall (hence the uninstall error).

dpi’s picture

Just to be clear, the patch does not have it. It's already in Registration. Commit #f36156c4.

hook_uninstall does not need to delete rows if the table is being dropped by Drupal.

luketsimmons’s picture

Hi all,

So my patch was more aimed towards an upgrade path and not an uninstall/re-install process, hence why I wasn't checking for a registration_state table existence in uninstall.

Also if it's in beta3 already then that's cool, as my update was from alpha5 > beta1. So we could merge my hook_update_N's with the beta3 install file ready for beta4?

thanks,
luke

luketsimmons’s picture

Sorry I did suggest that you could update to Beta3 in #9, my bad as I hadn't tested that yet, just Beta1.

thanks,
luke

levelos’s picture

Status: Needs review » Closed (won't fix)

Gang - Not sure what the goal of this ticket is, but the patch as stands empties the hook_install() function which is a non-starter. We've stated clearly from day one that there will be no upgrade path from alpha. If the community works to create an upgrade patch, that's obviously great if folks find it useful, but we're not going to commit to the module. Thanks for understanding and let us know what we can to help anyone who's still stuck in alpha land.

luketsimmons’s picture

StatusFileSize
new15.11 KB

Morning levelos,

OK no worries, yes my patch was always intended as an upgrade path for those moving from Alpha05 > Beta01.

But I've re-rolled and added the hook_install back in. It can live on this thread for anyone who wants to use it if that's OK?

Thanks and love the module btw!
luke

levelos’s picture

@luketsimmons - Thanks for the patch and I certainly didn't imply that it can't live on! I hope folks find it helpful. I also don't want to keep the ticket active implying work still needs to be done here. Is there a better solution? Perhaps a handbook page dedicated to RedHen recipes would be helpful? If so, we can set that and move this over.