Follow-up to #1277908: Introduce UUIDs onto panes & displays for better exportability & features compatibility. See http://drupal.org/comment/8430929#comment-8430929

Because the UUID functions were moved to Ctools, people updating Panels can get "Fatal error: Call to undefined function ctools_uuid_generate()"

The following patch ensures that update won't run in that situation:
https://drupal.org/files/issues/panels-uuid_update_dependency-1277908-14...

However, we also want to account for people who already have Ctools (e.g. for Views), and then install Panels using the current dev release.

We could set dependencies[] = ctools (>1.3) in panels.info, but I've no idea how that behaves for -dev versions; the documentation doesn't cover it.

We might possibly need a recognisable "-alpha" ctools release to reference; but as dev snapshot releases do have version strings of sorts, they might be sufficient?

The current ctools snapshot says "7.x-1.3+30-dev"

So is this valid and correct for our purposes? dependencies[] = ctools (>=1.3+30-dev)

Comments

jweowu’s picture

Issue summary: View changes
jweowu’s picture

Status: Active » Needs review
StatusFileSize
new970 bytes

Revised patch. Untested.

tim.plunkett’s picture

Looking at https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_..., we can't use anything except 7.x-1.4.

I think we might need to roll a release just with that, and then focus on a full release in #2129033: [Meta] CTools 7.x-1.4 release

jweowu’s picture

Yes, unfortunately the following returns NULL, which is the "everything's fine" result.

drupal_check_incompatibility(drupal_parse_dependency("ctools (>=7.x-1.3+30-dev)"), "1.3")

So we either need to depend on ctools 1.4, OR we need to tag the current ctools dev version with a recognised label, such as 7.x-1.4-alpha1 which will work in a dependency.

jweowu’s picture

Status: Needs review » Needs work

I would recommend applying the original patch (with just the update hook ammendment) ASAP, however. That will prevent the more serious problem -- the one likely to affect more people -- which is having the panels update hook run but fail to do what it was supposed to do!

jawi’s picture

same issue here on updating to latest dev version of 31-jan-14.

Is this the best way to solve any issues?

https://drupal.org/files/issues/panels-uuid_update_dependency-1277908-14...

Or better downgrate to dev module of 21-jan-14 ?

jawi’s picture

Original patch of #5 does not work.

Patch https://drupal.org/files/issues/panels-uuid_update_dependency-1277908-14... Delivered the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'smulfun.cache_panels' doesn't exist: TRUNCATE {cache_panels} ; Array ( ) in cache_clear_all() (line 165 van /home/~/smulfun.nl/public_html/includes/cache.inc).

jweowu’s picture

Jawi: that sounds unrelated, but I can see that panels_update_7303 adds that table, so presumably you need to run (or re-run) the updates.

Did you run updates before, and encounter "Fatal error: Call to undefined function ctools_uuid_generate()" during the update?

Or did you simply forget to run updates in the first place?

If it was the former, could you please take note of whether panels_update_7302 runs again this time?

liza’s picture

@jweowu

nope. i got the same error as Jawi.

btw: i applied the patch because i got the initial error in this issue thread; but i had done the CTOOLS dev update that was pinged a day or two ago. so for all intent and purposes, PANELS is reading my CTOOLS as if it were an old version when in fact it isn't.

could this be related to the 7303 update failure?

jweowu’s picture

liza, are you still seeing "Fatal error: Call to undefined function ctools_uuid_generate()" ?

If so, could you please verify that the function ctools_uuid_generate() does exist in your ctools.module file?

If it does, check the system table of your database, and verify that the file path for ctools is what you think it is.

Updates 7302 and 7303 are not related. (And in fact, let's keep discussion of update 7303 and cache_panels out of this issue. If there's any genuine problem with that update, it needs to be raised in a separate issue.)

jerry’s picture

If there's any genuine problem with that update, it needs to be raised in a separate issue.

Said issue has been opened as #2188277.

liza’s picture

thanks for following up jweowu. after following your instructions, i found two issues with my build:

(1) the error for update 7302 was due to CTools. i didn't have the correct CTools and that's because i updated to the latest PANOPOLY distribution. am opening up an issue over there to bring it to their attention.

(2) the errors i was getting with update 7303 were due to the CONTEXT module. i had to completely disable it in order for drush to process the database properly. i'll open an issue over there as well.

so to recap: once i updated my CTOOLS to the latest dev and disabled the CONTEXT module, the updated was processed without a problem.

jawi’s picture

@ #12 Thanks for your best practices. With your gidelines I fixed the update issue as well.

  1. updated ctools to latest dev version
  2. disabled context module and context related modules
  3. updated panels to latest dev
  4. enabled ctools and related modules again

This issue was a pain in the ass - but in the end it is caused by an unpleasant coincidence.

liza’s picture

@Jawi
Awesome! am glad i could help. i also spent several hours trying to debug this :P

japerry’s picture

Sorry for the issues you guys saw! Unfortunately such is life on cutting edge dev.

When we release ctools and panels next week, the info file will require ctools > 1.3, but unfortunately we cannot do that right now.

jweowu’s picture

Status: Needs work » Needs review
StatusFileSize
new990 bytes
new991 bytes

Patch revised accordingly.

If the new version of ctools is going to be 1.4 (rather than an alpha or beta), it would seem nicer to specify (>=1.4) rather than (>1.3), so I've added both versions.

The last submitted patch, 16: panels-uuid_update_dependency_gt13-2187433-16.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 16: panels-uuid_update_dependency_gte14-2187433-16.patch, failed testing.

jweowu’s picture

Status: Needs work » Needs review
StatusFileSize
new962 bytes
new963 bytes

That's what I get for editing patch files directly.

Let's try that again...

damienmckenna’s picture

"CTools" is spelled with a capital 'T'.

japerry’s picture

Status: Needs review » Fixed

Fixed and rolled into panels before release!

jweowu’s picture

japerry: I see now that you didn't commit the change to panels_update_7302()

The reason I added that code was that I didn't think the new .info file dependency was sufficient to prevent a site with a pre-existing ctools <= 1.3 from running that panels update hook if the new panels was downloaded without the new ctools. And we absolutely want to prevent the update from running in that situation.

Was my assumption wrong? (I didn't test it, so it would be useful to know either way.)

japerry’s picture

jweowu -- I didn't notice it until it was too late. I think your assumption was right, and is in the patch for #2188277: "cache_panels doesn't exist" error on update

oh well. we'll be rolling panels 3.5 here in a few days it looks like

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.