Skip to content

Commit 73ce5f9

Browse files
committed
Removed some logging to make test debugging less verbose
1 parent a37cb61 commit 73ce5f9

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

app/Models/CustomField.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@ public static function name_to_db_name($name)
3838
public static function boot()
3939
{
4040
self::created(function ($custom_field) {
41-
\Log::debug("\n\nCreating Original Name: ".$custom_field->name);
42-
\Log::debug('Creating Column Name: '.$custom_field->convertUnicodeDbSlug());
4341

4442

43+
// column exists - nothing to do here
4544
if (Schema::hasColumn(CustomField::$table_name, $custom_field->convertUnicodeDbSlug())) {
46-
\Log::debug('Column exists. Nothing to do here.');
4745
return false;
4846
}
4947

@@ -57,18 +55,13 @@ public static function boot()
5755

5856

5957
self::updating(function ($custom_field) {
60-
\Log::debug('Updating column name');
61-
\Log::debug('Updating Original Name: '.$custom_field->getOriginal("name"));
62-
\Log::debug('Updating New Column Name: '.$custom_field->convertUnicodeDbSlug());
6358

59+
// Column already exists. Nothing to update.
6460
if ($custom_field->isDirty("name")) {
6561
if (Schema::hasColumn(CustomField::$table_name, $custom_field->convertUnicodeDbSlug())) {
66-
\Log::debug('Column already exists. Nothing to update.');
6762
return true;
6863
}
6964

70-
\Log::debug('Updating column name to.'.$custom_field->convertUnicodeDbSlug());
71-
7265
return Schema::table(CustomField::$table_name, function ($table) use ($custom_field) {
7366
$table->renameColumn($custom_field->convertUnicodeDbSlug($custom_field->getOriginal("name")), $custom_field->convertUnicodeDbSlug());
7467
});
@@ -85,7 +78,7 @@ public static function boot()
8578

8679
public function fieldset()
8780
{
88-
return $this->belongsToMany('\App\Models\CustomFieldset'); //?!?!?!?!?!?
81+
return $this->belongsToMany('\App\Models\CustomFieldset');
8982
}
9083

9184
public function user()
@@ -102,10 +95,9 @@ public function check_format($value)
10295
public function db_column_name()
10396
{
10497
return $this->db_column;
105-
// return self::convertUnicodeDbSlug();
10698
}
10799

108-
//mutators for 'format' attribute
100+
// mutators for 'format' attribute
109101
public function getFormatAttribute($value)
110102
{
111103
foreach (self::$PredefinedFormats as $name => $pattern) {
@@ -116,6 +108,13 @@ public function getFormatAttribute($value)
116108
return $value;
117109
}
118110

111+
/**
112+
* Format a value string as an array for select boxes and checkboxes.
113+
*
114+
* @author [A. Gianotto] [<[email protected]>]
115+
* @since [v3.4]
116+
* @return Array
117+
*/
119118
public function setFormatAttribute($value)
120119
{
121120
if (isset(self::$PredefinedFormats[$value])) {

app/Models/Loggable.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ public function logCheckout($note, $target = null /*target is overridable for co
8080
'admin' => $log->user,
8181
'note' => $note
8282
];
83-
Setting::getSettings()->notify(new CheckoutNotification($params));
8483

84+
if ($settings = Setting::getSettings()) {
85+
$settings->notify(new CheckoutNotification($params));
86+
}
87+
8588
return $log;
8689
}
8790

database/migrations/2017_01_25_063357_fix_utf8_custom_field_column_names.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
function updateLegacyColumnName($customfield) {
2222

2323
$name_to_db_name = CustomField::name_to_db_name($customfield->name);
24-
\Log::debug('Trying to rename '.$name_to_db_name." to ".$customfield->convertUnicodeDbSlug()."...\n");
24+
//\Log::debug('Trying to rename '.$name_to_db_name." to ".$customfield->convertUnicodeDbSlug()."...\n");
2525

2626
if (Schema::hasColumn(CustomField::$table_name, $name_to_db_name)) {
2727

@@ -32,7 +32,7 @@ function ($table) use ($name_to_db_name, $customfield) {
3232
);
3333

3434
} else {
35-
\Log::debug('Legacy DB column '.$name_to_db_name.' was not found on the assets table.');
35+
//\Log::debug('Legacy DB column '.$name_to_db_name.' was not found on the assets table.');
3636
}
3737

3838
}

database/migrations/2017_06_14_122059_add_next_autoincrement_to_settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function up()
2525
$table->bigInteger('next_auto_tag_base')->default('1');
2626
});
2727

28-
\Log::debug('Setting '.$next.' as default auto-increment');
28+
//\Log::debug('Setting '.$next.' as default auto-increment');
2929

3030
if ($settings = App\Models\Setting::first()) {
3131
$settings->next_auto_tag_base = $next;

0 commit comments

Comments
 (0)