Skip to content

Commit e0d36f4

Browse files
committed
Correct tabs->spaces
1 parent 503f40a commit e0d36f4

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

jcr_link_custom.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class jcr_link_custom
9696
/**
9797
* Initialise.
9898
*/
99-
function __construct()
99+
function __construct()
100100
{
101101
// Hook into the system's callbacks
102102
register_callback(array(__CLASS__, "lifecycle"), "plugin_lifecycle.jcr_link_custom");
@@ -164,23 +164,23 @@ public static function lifecycle($event, $step)
164164
safe_update("txp_lang", "data = 'Link Custom-Felder', owner = 'jcr_link_custom'", "name = 'jcr_link_custom' AND lang = 'de'");
165165
}
166166

167-
// Migrate from NULL to '' default value
168-
$has_nulls = safe_rows_start("*", "txp_link", "`jcr_link_custom_1` IS NULL OR `jcr_link_custom_2` IS NULL OR `jcr_link_custom_3` IS NULL OR `jcr_link_custom_4` IS NULL OR `jcr_link_custom_5` IS NULL");
169-
if (@numRows($has_nulls) > 0) {
170-
safe_update("txp_link", "jcr_link_custom_1 = ''", "jcr_link_custom_1 IS NULL");
171-
safe_update("txp_link", "jcr_link_custom_2 = ''", "jcr_link_custom_2 IS NULL");
172-
safe_update("txp_link", "jcr_link_custom_3 = ''", "jcr_link_custom_3 IS NULL");
173-
safe_update("txp_link", "jcr_link_custom_4 = ''", "jcr_link_custom_4 IS NULL");
174-
safe_update("txp_link", "jcr_link_custom_5 = ''", "jcr_link_custom_5 IS NULL");
175-
safe_alter(
176-
"txp_link",
177-
"MODIFY jcr_link_custom_1 VARCHAR(255) NOT NULL DEFAULT '',
178-
MODIFY jcr_link_custom_2 VARCHAR(255) NOT NULL DEFAULT '',
179-
MODIFY jcr_link_custom_3 VARCHAR(255) NOT NULL DEFAULT '',
180-
MODIFY jcr_link_custom_4 VARCHAR(255) NOT NULL DEFAULT '',
181-
MODIFY jcr_link_custom_5 VARCHAR(255) NOT NULL DEFAULT ''"
182-
);
183-
}
167+
// Upgrade: Migrate from NULL to '' default value
168+
$has_nulls = safe_rows_start("*", "txp_link","`jcr_link_custom_1` IS NULL OR `jcr_link_custom_2` IS NULLOR `jcr_link_custom_3` IS NULL OR `jcr_link_custom_4` ISNULL OR `jcr_link_custom_5` IS NULL");
169+
if (@numRows($has_nulls) > 0) {
170+
safe_update("txp_link", "jcr_link_custom_1 = ''", "jcr_link_custom_1 IS NULL");
171+
safe_update("txp_link", "jcr_link_custom_2 = ''", "jcr_link_custom_2 IS NULL");
172+
safe_update("txp_link", "jcr_link_custom_3 = ''", "jcr_link_custom_3 IS NULL");
173+
safe_update("txp_link", "jcr_link_custom_4 = ''", "jcr_link_custom_4 IS NULL");
174+
safe_update("txp_link", "jcr_link_custom_5 = ''", "jcr_link_custom_5 IS NULL");
175+
safe_alter(
176+
"txp_link",
177+
"MODIFY jcr_link_custom_1 VARCHAR(255) NOT NULL DEFAULT '',
178+
MODIFY jcr_link_custom_2 VARCHAR(255) NOT NULL DEFAULT '',
179+
MODIFY jcr_link_custom_3 VARCHAR(255) NOT NULL DEFAULT '',
180+
MODIFY jcr_link_custom_4 VARCHAR(255) NOT NULL DEFAULT '',
181+
MODIFY jcr_link_custom_5 VARCHAR(255) NOT NULL DEFAULT ''"
182+
);
183+
}
184184
break;
185185
case "deleted":
186186
// Remove columns from link table
@@ -518,7 +518,7 @@ function jcr_if_link_custom($atts, $thing = null)
518518
Example: Use @value="english"@ to output only those links whose “language” link custom field is english. Default: none.
519519

520520
@match@
521-
Match testing: exact, any, all, pattern. See the docs for if_custom_field:https://docs.textpattern.com/tags/if_custom_field.
521+
Match testing: exact, any, all, pattern. See the docs for "if_custom_field":https://docs.textpattern.com/tags/if_custom_field.
522522
Default: exact.
523523

524524
@separator@

0 commit comments

Comments
 (0)