Skip to content

Commit

Permalink
Fixed bug in the new file argument feature
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjonsson committed Nov 13, 2014
1 parent fb50818 commit 3bd88fc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions arlima.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://github.com/victorjonsson/Arlima
Description: Manage the order of posts on your front page, or any page you want. This is a plugin suitable for online newspapers that's in need of a fully customizable front page.
Author: VK (<a href="http://twitter.com/chredd">@chredd</a>, <a href="http://twitter.com/znoid">@znoid</a>, <a href="http://twitter.com/victor_jonsson">@victor_jonsson</a>, <a href="http://twitter.com/lefalque">@lefalque</a>)
Version: 3.0.beta.59
Version: 3.0.beta.61
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
Expand Down Expand Up @@ -327,7 +327,7 @@ function arlima_file_args($default) {
// Back compat, they should all be numeric
if( is_numeric($name) ) {
// This is the new way
$new_args[$arg['property']] = empty($file_args[$arg['property']]) ? $arg['value'] : $file_args[$arg['property']];
$new_args[$arg['property']] = !isset($file_args[$arg['property']]) ? $arg['value'] : $file_args[$arg['property']];
}
elseif( empty($file_args[$name]) ) {
$new_args[$name] = is_array($arg) ? $arg['value'] : $arg;
Expand Down
2 changes: 1 addition & 1 deletion constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
or define('ARLIMA_COMPILE_LESS_IN_BROWSER', ARLIMA_DEV_MODE);

// Plugin version (only edit this via grunt!)
define('ARLIMA_FILE_VERSION', '3.0.beta.59' .(ARLIMA_DEV_MODE ? '__'.time():''));
define('ARLIMA_FILE_VERSION', '3.0.beta.61' .(ARLIMA_DEV_MODE ? '__'.time():''));

// Which type of tag to use for images in Arlima RSS feeds
defined('ARLIMA_RSS_IMG_TAG')
Expand Down
2 changes: 1 addition & 1 deletion js/arlima/arlima.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion pages/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,18 @@
<tr>
<td colspan="2">
<div class="file-include"
data-args='<?php echo json_encode($arlima_file_include->getFileArgs($file)) ?>'
data-args='<?php
// Add prop name to key for faster lookups in js
$args = array();
foreach($arlima_file_include->getFileArgs($file) as $name => $data) {
if( is_numeric($name) ) {
$args[$data['property']] = $data;
} else {
$args[$name] = $data; // Backwards compat
}
}
echo json_encode($args);
?>'
data-file="<?php echo $file; ?>"
data-label="<?php echo $label ?>">
<?php echo $label; ?>
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: @chredd, @znoid, @victor_jonsson, @lefalque, @aaslun
Tags: CMS, e-paper, e-magazine, magazine, newspaper, front page, wysiwyg
Requires at least: 3.8
Tested up to: 3.9.1
Stable tag: 3.0.beta.59
Stable tag: 3.0.beta.61
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down

0 comments on commit 3bd88fc

Please sign in to comment.