The ‘Button’ block went missing with WordPress 5.4 update; we now whitelisted and the button is available again. A new tracking solution for Global Projects, which aims to create a single standard convention for multiple channels and help the organization accurately report on a project’s impact has been implemented. And a lot of bugs being fixed.

Enjoy!


Release v2.29 (22.04.2020)

🎩 Design and UX/ Functionalities

  • PLANET-4924Re-enable the native ‘Button’ block
    • WordPress 5.4 re-arranged the ‘Button‘ block and moved it from Common to Layout category. The team did the following tasks:
      • Disabled border radius option
      • Allowed only the colors from the color palette
      • Ensured that it still follows the P4 custom styles
      • Whitelisted ‘Button‘ block

📊 Data and Analytics

  • PLANET-4855Pull “Global Project” values from Smartsheet to campaign dropdowns (dataLayer)
    • Values from the “Global Project Standards” (first column) are now feed in the “Campaign” dropdown
    • A filter was applied – sync only the “Global Project Standards” values which have the “Standard Approved” value as true [column highlighted in blue here]
    • The values have been oredered in alphabetical order
    • The dropdown has been renamed from “Select Campaign” to “Select Global Project”
    • Values are fetched from smartsheet through the API every time when a new campaign page is created. Cache only for 5 minutes.
    • The sidebar section is renamed from “Campaign Information (dataLayer)” to “Analytics & Tracking”
    • Existing selection/data is kept (doesn’t changes) after list is updated
  • PLANET-4857 Add a new parameter ‘projectID’ to the dataLayer
    • A new parameter [projectID] has been added to the dataLayer.push (on all Planet 4 content)
    • The right “Tracking ID” value has been pulled from the GP Global Project Standards (SSOT) according to the “Global Project” value selected by the editor
    • The specific “Tracking ID” [projectID]  __ value together with the “Global Project Standard” [gCampaign] has been sent via dataLayer 
  • PLANET-4859Pull “Local Project” values from each NRO’s Smartsheet table
    • The former tracking system was not allowing any customization, which prevented NROs from using it. To solve this, we wanted to synchronise each NRO’s Smartsheet table (where they should define their Local Projects values) with their respective Planet 4 instance.  
    • The team created a new dropdown field called “Local Projects” inside the “Analytics & Tracking” settings
    • The values displayed on this dropdown should be pulled from each NRO’s Smartsheet table.
    • We applied a filter: sync only the values which have the “Standard Approved” value as true
    • Ordered the values in alphabetical order
    • Added a new parameter to the dataLayer.push called ‘gLocalProject’ and sent the values selected on the Local Project dropdown
    • Sent API requests to sync the “GP Data Standards” table with Planet 4 every 5 minutes

🐛 Bug Fixes

  • PLANET-4990Error upon logging in via Google
    • A change on Google’s OAuth API caused some login errors in many NRO websites. A new version was released by the relevant WP plugin that fixes this issue.
  • PLANET-4705Header Carousel: icon to delete image is not shown
    • When an Editor is trying to replace an image in the Header Carousel they should expect to see an X in the upper right corner of the slide to delete the current image.
Header Carousel image editor missing the ‘X’ button
  • PLANET-4901P4CG Campaign Sidebar: Ensure fields with dependencies get the right defaults
    • The color of the logo was selected automatically when editor would change it from the default Greenpeace logo to a Campaign logo.
    • The team looked for a solution in the client side, probably around resolveDependency.
    • The committed patch was removed.
  • PLANET-4927Planet 4 Bug Report: Page, Evergreen: Spacing issue when using background image
    • There were spacing issues throughout the Evergreen template,
    • When adding a background image the page was revealing a space at the top of the page (in addition to the space now appearing below the menu)
    • The team investigated why space is shown on top and removed it and changed code to be more robust.
  • PLANET-4975Non-pdf attachments are returned by search
    • When performing any search, images were returned in the search results, which was not intended. Images are attachments in WordPress, and so are PDFs. We only want PDFs in the search results, but it’s including all attachments.
    • The team removed existing filters in multiple places, one of which was not working.

Geek alert

(this section is dedicated to developers or web editors with advanced tech knowledge)

  • PLANET-4738Search ErrorException: Warning: Invalid argument supplied for foreach()

Sentry Issue: PLANET4-2J

ErrorException: Warning: Invalid argument supplied for foreach()
  File "/app/source/public/wp-content/themes/planet4-master-theme/classes/class-p4-search.php", line 198, in P4_Search::get_paged_posts
    foreach ( $filter_type as $name => $id ) {
  File "/app/source/public/wp-includes/class-wp-hook.php", line 288, in WP_Hook::apply_filters
    $value = call_user_func_array( $the_['function'], $args );
  File "/app/source/public/wp-includes/class-wp-hook.php", line 312, in WP_Hook::do_action
    $this->apply_filters( '', $args );
  File "/app/source/public/wp-includes/plugin.php", line 478, in do_action
    $wp_filter[ $tag ]->do_action( $arg );
  File "/admin-ajax.php", line 190
    do_action( "wp_ajax_nopriv_{$action}" );
  • PLANET-4953Sentry\Exception\FatalErrorExceptionError: Uncaught TypeError: Return value of P4_User::name() must be of the type string…

Sentry Issue: PLANET4-D0

Sentry\Exception\FatalErrorException
Error: Uncaught TypeError: Return value of P4_User::name() must be of the type string, null returned in /app/source/public/wp-content/themes/planet4-master-theme/classes/class-p4-user.php:76
Stack trace:
#0 /app/source/public/wp-content/plugins/timber-library/lib/User.php(154): P4_User->name()
#1 /app/source/public/wp-content/plugins/timber-library/lib/User.php(82): Timber\User->init(56)
#2 /app/source/public/wp-content/themes/planet4-master-theme/classes/class-p4-user.php(34): Timber\User->__construct(56)
#3 /app/source/public/wp-content/themes/planet4-master-theme/classes/class-p4-post.php(396): P4_User->__construct(56)
#4 /app/source/public/wp-content/themes/planet4-master-theme/classes/class-p4-post.php(61): P4_Post->set_author()
#5 /app/source/public/wp-content/plugins/timber-library/lib/QueryIterator.php(132): P4_Post->__construct(Object(WP_Post))
#6 /app/source/public/wp-content/plugins/timber-library/lib/PostGetter.php(62): Timber\QueryIterator->current()
#7 /app/source/public/wp-content/plugins/timber-libra