INN / umbrella-borderzine

Umbrella repository for borderzine.com/
GNU General Public License v2.0
0 stars 1 forks source link

Research special projects pages content not displaying #72

Open joshdarby opened 4 years ago

joshdarby commented 4 years ago

http://borderzine.com includes a Special Projects nav dropdown with multiple pages and none of these pages are displaying their content on our staging environment.

We need to figure out how the content was added to these pages and figure out how to fix it on the staging site.

benlk commented 4 years ago

I think this is done using the plugin https://wordpress.org/plugins/siteorigin-panels/

Based on a sample size of one, using http://borderzine.com/a-fragile-peace/ and the editor interface at http://borderzine.com/wp-admin/post.php?post=22554&action=edit&classic-editor

Screen Shot 2019-10-03 at 20 45 43

There are a couple of other plugins installed that may be in use on other pages:

Fixing it on the staging site will require reactivating these plugins, but in the long run it may be a better idea to propose an alternative archival solution.

benlk commented 4 years ago

With this plugin active on staging, the modules are present but lacking in actual editors:

Screen Shot 2019-10-04 at 16 53 39

So I'm gonna copy Snowball from the current site over to staging to see if that's what it is.

benlk commented 4 years ago

Copying Snowball over did not work.

The post_content for post 22461 is empty in the database.

It looks like all the post "content" is in the panels_data meta key:

+---------+----------------------+----------------------------------------------------------------------+
| post_id | meta_key             | meta_value                                                           |
+---------+----------------------+----------------------------------------------------------------------+
| 22461   | module_positions     | a:6:{s:22:"module_positions_order";i:0;s:23:"module_positions_markup |
|         |                      | ";s:0:"";s:21:"module_positions_menu";s:0:"";s:25:"module_positions_ |
|         |                      | position";s:0:"";s:29:"module_positions_type_special";s:0:"";s:29:"m |
|         |                      | odule_positions_item_special";s:0:"";}                               |
| 22461   | module_positions     | a:6:{s:22:"module_positions_order";i:0;s:23:"module_positions_markup |
|         |                      | ";s:0:"";s:21:"module_positions_menu";s:0:"";s:25:"module_positions_ |
|         |                      | position";s:0:"";s:29:"module_positions_type_special";s:0:"";s:29:"m |
|         |                      | odule_positions_item_special";s:0:"";}                               |
| 22461   | _edit_last           | 11411                                                                |
| 22461   | _wp_page_template    | page-blocks.php                                                      |
| 22461   | panels_data          | a:3:{s:7:"widgets";a:6:{i:0;a:2:{s:4:"text";s:81:"<h1 style="font-si |
|         |                      | ze: 30pt;">Borderzine Presents: El Paso's Creative Economy</h1>";s:4 |
|         |                      | :"info";a:4:{s:5:"class";s:23:"Bunyad_PbBasic_RichText";s:2:"id";s:1 |
|         |                      | :"1";s:4:"grid";s:1:"0";s:4:"cell";s:1:"0";}}i:1;a:2:{s:4:"text";s:9 |
|         |                      | 87:"<h2><em>Borderzine Presents</em> is a TV-style news show on the  |
|         |                      | internet that explores segments of Border Life. The show is produced |
|         |                      |  by students in the UT El Paso journalism program who work in teams  |
|         |                      | to create multimedia story packages that are broadcast via Google Ha |
|         |                      | ngouts on Air events and YouTube, then published on the bilingual bo |
|         |                      | rder life magazine website <a href="https://borderzine.test/" target |
|         |                      | ="_blank" rel="nofollow nofollow">Borderzine.com.</a> UTEP's <a href |
|         |                      | ="http://academics.utep.edu/Default.aspx?tabid=14118" target="_blank |
|         |                      | ">Sam Donaldson Center for Communication Studies</a> helps sponsor t |
|         |                      | he training for the students. The first show, <em>Borderzine Present |
|         |                      | s: El Paso's Creative Economy</em>, aired May 29, 2015 at the conclu |
|         |                      | sion of a special 9-day Maymester course.</h2><p style="text-align:  |
|         |                      | right;"><span style="color: #376dc8;"><a href="https://borderzine.te |
|         |                      | st/">More about Borderzine </a>| <a href="https://borderzine.test/"> |
|         |                      | Mas sobre Borderzine</a></span></p>";s:4:"info";a:4:{s:5:"class";s:2 |
|         |                      | 3:"Bunyad_PbBasic_RichText";s:2:"id";s:1:"2";s:4:"grid";s:1:"1";s:4: |
|         |                      | "cell";s:1:"0";}}i:2;a:2:{s:4:"text";s:293:"<p><a href="https://bord |
|         |                      | erzine.test/wp-content/uploads/2015/06/BORDERZINERev2x600-1.jpg"><im |
|         |                      | g class="alignleft size-medium wp-image-22464" src="https://borderzi |
|         |                      | ne.test/wp-content/uploads/2015/06/BORDERZINERev2x600-1-600x113.jpg" |
|         |                      |  alt="BORDERZINERev2x600 (1)" width="600" height="113" /></a></p>";s |
|         |                      | :4:"info";a:4:{s:5:"class";s:23:"Bunyad_PbBasic_RichText";s:2:"id";s |
|         |                      | :1:"3";s:4:"grid";s:1:"1";s:4:"cell";s:1:"0";}}i:3;a:2:{s:4:"text";s |
|         |                      | :843:"<div class="youaremysunshine"><p><strong><a href="https://bord |
|         |                      | erzine.test/wp-content/uploads/2015/06/BorderzinePresentsCrew_croppe |
|         |                      | d.jpg"><img class=" size-medium wp-image-22462 aligncenter" src="htt |
|         |                      | ps://borderzine.test/wp-content/uploads/2015/06/BorderzinePresentsCr |
|         |                      | ew_cropped-537x400.jpg" alt="BorderzinePresentsCrew_cropped" width=" |
|         |                      | 537" height="400" /></a></strong></p><h1 style="text-align: left;">  |
|         |                      | Teamwork making dreams come true</h1><p>The multimedia journalism pr |
|         |                      | ogram in the Communication Department at UT El Paso strives to provi |
|         |                      | de the hands-on training that the next generation of journalists nee |
|         |                      | d to stand out. We are grateful for the contribution of time and exp |
|         |                      | ertise of professionals from area newsrooms who participated in the  |
|         |                      | May 2015 Broadcast News course and helped our students produce Borde |
|         |                      | rzine Presents.  </p></div>";s:4:"info";a:4:{s:5:"class";s:23:"Bunya |
|         |                      | d_PbBasic_RichText";s:2:"id";s:1:"4";s:4:"grid";s:1:"1";s:4:"cell";s |
|         |                      | :1:"1";}}i:4;a:2:{s:4:"text";s:117:"<div class="titlespecial"><hr /> |
|         |                      | <h1 class="mariaismysunshine">Featured Stories</h1><hr class="sunshi |
|         |                      | nemaria" /></div>";s:4:"info";a:4:{s:5:"class";s:23:"Bunyad_PbBasic_ |
|         |                      | RichText";s:2:"id";s:1:"5";s:4:"grid";s:1:"2";s:4:"cell";s:1:"0";}}i |
|         |                      | :5;a:13:{s:12:"no_container";s:1:"1";s:5:"posts";s:2:"14";s:7:"sort_ |
|         |                      | by";s:0:"";s:10:"sort_order";s:4:"desc";s:4:"type";s:0:"";s:7:"headi |
|         |                      | ng";s:0:"";s:12:"heading_type";s:5:"block";s:10:"pagination";s:1:"0" |
|         |                      | ;s:4:"cats";a:1:{i:0;s:4:"6868";}s:4:"tags";s:0:"";s:6:"offset";s:1: |
|         |                      | "0";s:9:"post_type";s:0:"";s:4:"info";a:4:{s:5:"class";s:23:"Bunyad_ |
|         |                      | PageBuilder_Blog";s:2:"id";s:1:"6";s:4:"grid";s:1:"5";s:4:"cell";s:1 |
|         |                      | :"0";}}}s:5:"grids";a:6:{i:0;a:2:{s:5:"cells";s:1:"1";s:5:"style";s: |
|         |                      | 0:"";}i:1;a:2:{s:5:"cells";s:1:"2";s:5:"style";s:0:"";}i:2;a:2:{s:5: |
|         |                      | "cells";s:1:"1";s:5:"style";s:0:"";}i:3;a:2:{s:5:"cells";s:1:"1";s:5 |
|         |                      | :"style";s:0:"";}i:4;a:2:{s:5:"cells";s:1:"1";s:5:"style";s:0:"";}i: |
|         |                      | 5;a:2:{s:5:"cells";s:1:"1";s:5:"style";s:0:"";}}s:10:"grid_cells";a: |
|         |                      | 7:{i:0;a:2:{s:6:"weight";s:1:"1";s:4:"grid";s:1:"0";}i:1;a:2:{s:6:"w |
|         |                      | eight";s:3:"0.5";s:4:"grid";s:1:"1";}i:2;a:2:{s:6:"weight";s:3:"0.5" |
|         |                      | ;s:4:"grid";s:1:"1";}i:3;a:2:{s:6:"weight";s:1:"1";s:4:"grid";s:1:"2 |
|         |                      | ";}i:4;a:2:{s:6:"weight";s:1:"1";s:4:"grid";s:1:"3";}i:5;a:2:{s:6:"w |
|         |                      | eight";s:1:"1";s:4:"grid";s:1:"4";}i:6;a:2:{s:6:"weight";s:1:"1";s:4 |
|         |                      | :"grid";s:1:"5";}}}                                                  |
| 22461   | rt_custom_css        | .cat-title{ display:none; }  .youaremysunshine{ border-left: 2px sol |
|         |                      | id #A2D4E2; padding-left: 10px; }  .builder{ margin-bottom: 15px !im |
|         |                      | portant; }  .titlespecial{ margin-bottom: -50px !important; margin-t |
|         |                      | op: -50px; }  .sunshinemaria{ margin-top: -23px; }  .mariaismysunshi |
|         |                      | ne{  margin-top: -35px; }  hr { border: 0; color: #A2D4E2; backgroun |
|         |                      | d: #A2D4E2; height: 2px; }  nav { display: none; }  .breadcrumbs{ di |
|         |                      | splay:none; }  .AuthorSpan{ display: none; }  .main-footer { display |
|         |                      | :none; }  header{ display: none; }  .no-break{ display: none; }      |
| 22461   | _ssb_hide            | false                                                                |
| 22461   | _bunyad_page_title   | no                                                                   |
| 22461   | _bunyad_layout_style | full                                                                 |
| 22461   | _edit_lock           | 1547429267:11411                                                     |
| 22461   | enablewpts           | 0                                                                    |
| 22461   | slide_template       | default                                                              |
| 22461   | _dp_original         | 21321                                                                |
| 22461   | _yoast_wpseo_title   | Borderzine Presents                                                  |
+---------+----------------------+----------------------------------------------------------------------+

The _wp_page_template value being page-blocks.php suggests to me that this content was output via a custom template that presently only exists on borderzine.com. I'll see if I can get a copy of it.

benlk commented 4 years ago
<?php
/*
    Template Name: Homepage & Blocks (Advanced)
*/

get_header();

if (Bunyad::posts()->meta('featured_slider')):
    get_template_part('partial-sliders');
endif;

?>

<div class="main wrap cf">

    <div class="row">
        <div class="col-8 main-content">

            <?php if (have_posts()): the_post(); endif; // load the page ?>

            <div id="post-<?php the_ID(); ?>" <?php post_class('page-content'); ?>>

            <?php if (Bunyad::posts()->meta('page_title') == 'yes'): ?>

                <header class="post-header">                

                <?php if (has_post_thumbnail()): ?>
                    <div class="featured">
                        <a href="<?php $url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); echo $url[0]; ?>" title="<?php the_title_attribute(); ?>">

                        <?php if ((!in_the_loop() && Bunyad::posts()->meta('layout_style') == 'full') OR Bunyad::core()->get_sidebar() == 'none'): // largest images - no sidebar? ?>

                            <?php the_post_thumbnail('main-full', array('title' => strip_tags(get_the_title()))); ?>

                        <?php else: ?>

                            <?php the_post_thumbnail('main-slider', array('title' => strip_tags(get_the_title()))); ?>

                        <?php endif; ?>

                        </a>
                    </div>
                <?php endif; ?>

                    <h1 class="main-heading">
                        <?php the_title(); ?>
                    </h1>
                </header><!-- .post-header -->

            <?php endif; ?>

            <?php Bunyad::posts()->the_content(); ?>

            </div>

        </div>

        <?php Bunyad::core()->theme_sidebar(); ?>

    </div> <!-- .row -->
</div> <!-- .main -->

<?php get_footer(); ?>
benlk commented 4 years ago

In attempting to copy the relevant functionality from that into the child theme, I copied all bunyad-related plugins from staging to my local env.

The function that appears to be relevant is this:

<?php Bunyad::posts()->the_content(); ?>

However, attempting to use it in a page template fails.

PHP message: PHP Warning:  require_once(/Users/blk/sites/borderzine/wp-content/plugins/bunyad-shortcodes/lib/posts.php): failed to open stream: No such file or directory in /Users/blk/sites/borderzine/wp-content/plugins/bunyad-shortcodes/lib/bunyad.php on line 35
PHP message: PHP Fatal error:  require_once(): Failed opening required '/Users/blk/sites/borderzine/wp-content/plugins/bunyad-shortcodes/lib/posts.php' (include_path='.:/usr/local/Cellar/php/7.3.5/share/php/pear') in /Users/blk/sites/borderzine/wp-content/plugins/bunyad-shortcodes/lib/bunyad.php on line 35

Note that the failure to open the file is a fatal error, which means we can't try/catch it as I was trying to in https://github.com/INN/umbrella-borderzine/blob/72-special-projects-pages-template/wp-content/themes/borderzine/page-blocks.php

The Bunyad class appears to be defined in the bunyad-shortcodes plugin:

$ wp shell
wp> $reflector = new \ReflectionClass('Bunyad');
=> object(ReflectionClass)#1662 (1) {
  ["name"]=>
  string(6) "Bunyad"
}
wp> echo $reflector->getFileName();
/Users/user/sites/borderzine/wp-content/plugins/bunyad-shortcodes/lib/bunyad.php

The Bunyad class defines the posts() method as a wrapper for a factory that checks for the existence of the Bunyad_Posts class, and if not, loads lib/posts.php

And, indeed, the plugin does not contain that file.

/bunyad-shortcodes$ tree .
.
├── admin
│   └── tinymce
│       ├── editor-plugin.php
│       ├── shortcode-dialogs
│       │   ├── accordions.php
│       │   ├── box.php
│       │   ├── button.php
│       │   ├── columns.php
│       │   ├── lists.php
│       │   ├── tabs.php
│       │   └── toggles.php
│       └── shortcode-popup.php
├── admin.php
├── blocks
│   └── latest-gallery.php
├── bunyad-shortcodes.php
├── css
│   └── shortcodes.css
├── languages
│   └── bunyad-shortcodes.pot
└── lib
    ├── admin
    │   └── option-renderer.php
    └── bunyad.php

So at this point I'm assuming that the reason for the broken visual editor here and the failure of the template I was working on here are both because the copy of the bunyad-shortcodes plugin we have on staging is incomplete, and was not completely copied from the live site.

Next steps:

  1. Get a clean copy of the plugin
  2. Continue work in https://github.com/INN/umbrella-borderzine/blob/72-special-projects-pages-template/wp-content/themes/borderzine/page-blocks.php
benlk commented 4 years ago

Notes from Slack:

The list of special reports:

URL type estimate question
http://borderzine.com/a-fragile-peace/ page, two columns ( text | images ), then list of posts 15m
http://mexodus.borderzine.com/ offsite link 0  
http://borderzine.com/borderlands2017/ one col, page (image, text) then two-col list of posts   is this BORD-002?
http://borderzine.com/borderzine-presents/ page, two columns (text | images), then list of posts 15m  
http://borderzine.com/borderzine-presents-hidden-el-paso/ page, two columns ( text | images ), then list of posts 15m  
http://borderzine.com/special-report-pope-visits-juarez/ page, two columns ( text | image ), then list of posts 15m  
http://borderzine.com/special-project-djnfmta/ page, two columns ( text | images ), then list of posts 15m  
http://borderzine.com/journalisminjuly/ page, two columns (text | text) No posts 15m  
http://borderzine.com/election-2016-latino-vote/ page, list of posts then text 15m  
http://borderzine.com/beto-presidential-run/ page, header, image, two columns (text | text), posts 15m  

Questions for @MirandaEcho:

benlk commented 4 years ago

Yes on the second question:

Next steps for each of the ones we're porting:

List of ones requiring porting:

joshdarby commented 4 years ago

http://borderzine.flywheelsites.com/journalisminjuly/ Workshop Project Pages section links out to these pages that will also need their content ported:

MirandaEcho commented 4 years ago

We do need to create the Borderlands landing page - its separate from the new project

joshdarby commented 4 years ago

@MirandaEcho Borderlands page can be found here: http://borderzine.flywheelsites.com/category/special-projects/borderlands_project/