Skip to content

Commit 7d5f23e

Browse files
committed
Merge pull request #323 from opencredit/alpha
Merge 1.4.1 release from alpha.
2 parents 030e7e6 + cc23cb1 commit 7d5f23e

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

badgeos.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: http://www.badgeos.org/
55
* Description: BadgeOS lets your site’s users complete tasks and earn badges that recognize their achievement. Define achievements and choose from a range of options that determine when they're complete. Badges are Mozilla Open Badges (OBI) compatible through integration with the “Open Credit” API by Credly, the free web service for issuing, earning and sharing badges for lifelong achievement.
66
* Author: LearningTimes
7-
* Version: 1.4.0
7+
* Version: 1.4.1
88
* Author URI: https://credly.com/
99
* License: GNU AGPL
1010
*/
@@ -32,7 +32,7 @@ class BadgeOS {
3232
*
3333
* @var string
3434
*/
35-
public static $version = '1.4.0';
35+
public static $version = '1.4.1';
3636

3737
function __construct() {
3838
// Define plugin constants

includes/achievement-functions.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,10 +830,12 @@ function badgeos_maybe_update_achievement_type( $data = '', $post_args = '' ) {
830830
* @return bool True if name has changed, otherwise false.
831831
*/
832832
function badgeos_achievement_type_changed( $post_args = array() ) {
833+
$original_post = isset( $post_args['ID'] ) ? get_post( $post_args['ID'] ) : null;
833834
return (
834835
'achievement-type' === $post_args['post_type']
835-
&& $post_args['ID']
836-
&& get_post( $post_args['ID'] )->post_title !== $post_args['post_title']
836+
&& is_object( $original_post )
837+
&& ! empty( $original_post->post_name )
838+
&& $original_post->post_title !== $post_args['post_title']
837839
);
838840
}
839841

@@ -847,6 +849,12 @@ function badgeos_achievement_type_changed( $post_args = array() ) {
847849
* @return string New achievement type.
848850
*/
849851
function badgeos_update_achievement_types( $original_type = '', $new_type = '' ) {
852+
853+
// Sanity check to prevent alterating core posts
854+
if ( ! $original_type || in_array( $original_type, array( 'post', 'page', 'attachment', 'revision', 'nav_menu_item' ) ) ) {
855+
return $new_type;
856+
}
857+
850858
badgeos_update_achievements_achievement_types( $original_type, $new_type );
851859
badgeos_update_p2p_achievement_types( $original_type, $new_type );
852860
badgeos_update_earned_meta_achievement_types( $original_type, $new_type );

readme.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: http://badgeos.org/contribute/donate/
44
Tags: badge, badges, openbadges, learningtimes, credly, OBI, mozilla, open badges, achievement, award, reward, engagement, submission, nomination, API, open credit, credit
55
Requires at least: 3.6
66
Tested up to: 3.9.1
7-
Stable tag: 1.4.0
7+
Stable tag: 1.4.1
88
License: GNU AGPLv3
99
License URI: http://www.gnu.org/licenses/agpl-3.0.html
1010

@@ -119,11 +119,11 @@ BadgeOS is extremely powerful and infinitely extensible. Check out some of the o
119119
* Optional notification emails inform you when people on your site have made submissions or nominated peers.
120120
* Submission Notification Settings: Specify an unlimited number of email addresses for submission admin notifications.
121121
* Notifications for: new submissions, new comments, and submission status changes
122+
* Filter Submissions to only show those from members of specific BuddyPress Groups (requires plugins: [BuddyPress](http://wordpress.org/extend/plugins/buddypress/ "BuddyPress") and [BadgeOS Community Add-on](http://wordpress.org/extend/plugins/badgeos-community-add-on/ "BadgeOS Community Add-on"))
122123

123124

124125
= Extensibility and BadgeOS Add-ons =
125126

126-
127127
* BadgeOS is designed to be a true operating system for turning any WordPress site into an engagement management application.
128128
* BadgeOS offers a growing catalog of [Add-ons](http://badgeos.org/add-ons/ "BadgeOS Add-ons") to the plugin that enhance core functionality with specialized functions.
129129
* Built with expandability in mind to allow virtually anything to trigger and recognize achievement.
@@ -220,6 +220,9 @@ Thanks for asking! Please do share back code modifications or enhancements you
220220

221221
== Changelog ==
222222

223+
= 1.4.1 =
224+
* Fixed: Eliminated a critical bug that could cause all posts to be migrated to a brand new achievement type on publish.
225+
223226
= 1.4.0 =
224227
* Added: BadgeOS Shortcode Embedder – Easily add any shortcode to any content area with a few clicks.
225228
* Added: BadgeOS Shortcode registration API – Easily add support for new BadgeOS-related shortcodes and modify existing shortcodes with automatic support for the BOS Shortcode Embedder and help page.
@@ -355,6 +358,9 @@ Thanks for asking! Please do share back code modifications or enhancements you
355358

356359
== Upgrade Notice ==
357360

361+
= 1.4.1 =
362+
* Fixed: Eliminated a critical bug that could cause all posts to be migrated to a brand new achievement type on publish.
363+
358364
= 1.4.0 =
359365
* Added: BadgeOS Shortcode Embedder – Easily add any shortcode to any content area with a few clicks.
360366
* Added: BadgeOS Shortcode registration API – Easily add support for new BadgeOS-related shortcodes and modify existing shortcodes with automatic support for the BOS Shortcode Embedder and help page.

0 commit comments

Comments
 (0)