mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 18:31:05 +00:00
fix: set location to null when getting empty string
This commit is contained in:
parent
2ceaaca44f
commit
71b1b5f775
@ -137,7 +137,9 @@ class EpisodeController extends BaseController
|
|||||||
'audio_file' => $this->request->getFile('audio_file'),
|
'audio_file' => $this->request->getFile('audio_file'),
|
||||||
'description_markdown' => $this->request->getPost('description'),
|
'description_markdown' => $this->request->getPost('description'),
|
||||||
'image' => $image,
|
'image' => $image,
|
||||||
'location' => new Location($this->request->getPost('location_name')),
|
'location' => $this->request->getPost('location_name') === '' ? null : new Location($this->request->getPost(
|
||||||
|
'location_name'
|
||||||
|
)),
|
||||||
'transcript' => $this->request->getFile('transcript'),
|
'transcript' => $this->request->getFile('transcript'),
|
||||||
'chapters' => $this->request->getFile('chapters'),
|
'chapters' => $this->request->getFile('chapters'),
|
||||||
'parental_advisory' =>
|
'parental_advisory' =>
|
||||||
@ -242,7 +244,9 @@ class EpisodeController extends BaseController
|
|||||||
$this->episode->title = $this->request->getPost('title');
|
$this->episode->title = $this->request->getPost('title');
|
||||||
$this->episode->slug = $this->request->getPost('slug');
|
$this->episode->slug = $this->request->getPost('slug');
|
||||||
$this->episode->description_markdown = $this->request->getPost('description');
|
$this->episode->description_markdown = $this->request->getPost('description');
|
||||||
$this->episode->location = new Location($this->request->getPost('location_name'));
|
$this->episode->location = $this->request->getPost('location_name') === '' ? null : new Location(
|
||||||
|
$this->request->getPost('location_name')
|
||||||
|
);
|
||||||
$this->episode->parental_advisory =
|
$this->episode->parental_advisory =
|
||||||
$this->request->getPost('parental_advisory') !== 'undefined'
|
$this->request->getPost('parental_advisory') !== 'undefined'
|
||||||
? $this->request->getPost('parental_advisory')
|
? $this->request->getPost('parental_advisory')
|
||||||
|
@ -207,7 +207,9 @@ class PodcastController extends BaseController
|
|||||||
'publisher' => $this->request->getPost('publisher'),
|
'publisher' => $this->request->getPost('publisher'),
|
||||||
'type' => $this->request->getPost('type'),
|
'type' => $this->request->getPost('type'),
|
||||||
'copyright' => $this->request->getPost('copyright'),
|
'copyright' => $this->request->getPost('copyright'),
|
||||||
'location' => new Location($this->request->getPost('location_name')),
|
'location' => $this->request->getPost('location_name') === '' ? null : new Location($this->request->getPost(
|
||||||
|
'location_name'
|
||||||
|
)),
|
||||||
'payment_pointer' => $this->request->getPost(
|
'payment_pointer' => $this->request->getPost(
|
||||||
'payment_pointer'
|
'payment_pointer'
|
||||||
) === '' ? null : $this->request->getPost('payment_pointer'),
|
) === '' ? null : $this->request->getPost('payment_pointer'),
|
||||||
@ -315,7 +317,9 @@ class PodcastController extends BaseController
|
|||||||
$this->podcast->owner_email = $this->request->getPost('owner_email');
|
$this->podcast->owner_email = $this->request->getPost('owner_email');
|
||||||
$this->podcast->type = $this->request->getPost('type');
|
$this->podcast->type = $this->request->getPost('type');
|
||||||
$this->podcast->copyright = $this->request->getPost('copyright');
|
$this->podcast->copyright = $this->request->getPost('copyright');
|
||||||
$this->podcast->location = new Location($this->request->getPost('location_name'));
|
$this->podcast->location = $this->request->getPost('location_name') === '' ? null : new Location(
|
||||||
|
$this->request->getPost('location_name')
|
||||||
|
);
|
||||||
$this->podcast->payment_pointer = $this->request->getPost(
|
$this->podcast->payment_pointer = $this->request->getPost(
|
||||||
'payment_pointer'
|
'payment_pointer'
|
||||||
) === '' ? null : $this->request->getPost('payment_pointer');
|
) === '' ? null : $this->request->getPost('payment_pointer');
|
||||||
|
@ -254,7 +254,7 @@
|
|||||||
'id' => 'location_name',
|
'id' => 'location_name',
|
||||||
'name' => 'location_name',
|
'name' => 'location_name',
|
||||||
'class' => 'form-input mb-4',
|
'class' => 'form-input mb-4',
|
||||||
'value' => old('location_name', $podcast->location->name),
|
'value' => old('location_name', $podcast->location_name),
|
||||||
]) ?>
|
]) ?>
|
||||||
<?= form_section_close() ?>
|
<?= form_section_close() ?>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user