Panels 3: Navigating an Upgrade from Alpha to Beta
Navigation : Back to Blog
Alpha?!
Often alpha releases come with the tag line:
Not for production release!
It's true, alpha releases are not stable and can be inconsistent. A team of developers and a careful eye towards your use case versus the can be leveraged to minimize any dangers. A more appropriate warning would be:
Not for production systems if you do not carefully evaluate your use case and/or you don't have a team of developers willing to create patches
After all, patches are the open source way to get things ready for production by end users. I'm excited by the functionality panels will bring to the drupal world. Besides defining site layouts, Panels can be the tool an admin can use to piece together a site (solving an obvious problem, Total Control).
Developers developing and Administrators administrating makes for a wonderful world.
Navigating Panels3 Alpha to Beta
The first thing to do is cleanly upgrade the panels code to the latest beta release, commit to your (D)VCS of choice, and run update.php
At this point, you'll find all your custom content types are gone, your site is broken and empty of all your hard work. Good, now we ford the river.
module_panels_content_types is now in ctools
modulename_panels_content_types() becomes modulename_ctools_content_types()
Content Types category and title are now declared in the hook
Before they had been part of the content type callback. Now the category and title are declared in the content_types() hook.
<?php
<br />$items</span><span style="color: #007700">[</span><span style="color: #DD0000">'software_buyers_guide'</span><span style="color: #007700">] = array (<br /> </span><span style="color: #DD0000">'title' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Software Buyers Guide'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'single' </span><span style="color: #007700">=> </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'content_types' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'csr_library_content_types_software_buyers_guide'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'title callback' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'csr_library_content_types_software_buyers_guide_title'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'render callback' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'csr_library_content_types_software_buyers_guide_render'</span><span style="color: #007700">,<br /> ); <br /></span><span style="color: #0000BB">
?>becomes
<?php
<br />$items</span><span style="color: #007700">[</span><span style="color: #DD0000">'software_buyers_guide'</span><span style="color: #007700">] = array (<br /> </span><span style="color: #DD0000">'title' </span><span style="color: #007700">=> </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Software Buyers Guide'</span><span style="color: #007700">),<br /> </span><span style="color: #DD0000">'single' </span><span style="color: #007700">=> </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'description' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'A listing of software buyers guide'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'category' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'Main Content Panes'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'content_types' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'csr_library_content_types_software_buyers_guide'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'title callback' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'csr_library_content_types_software_buyers_guide_title'</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'render callback' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'csr_library_content_types_software_buyers_guide_render'</span><span style="color: #007700">,<br /> ); <br /></span><span style="color: #0000BB">
?>Notice that single is now set to TRUE, and the description and category are declared.
Views Content Panes
To allow views to declare Content Panes the module Views Content Panes needs to be enabled again. The only change here is that it is now located in the Views category in admin/build/modules
Beta?!
Your content types should be available and loaded back into panels and your site is happy and healthy.
Comments
Post a comment
Presentations
What we've coded
Videos
Upcoming workshops
-
San Francisco, CAFebruary 28, 2012
-
Denver, COMarch 19, 2012
-
Denver, COMarch 19, 2012






Thank you for this good piece of code.