Extra field added when creating meta programatically

#1

My plugin is generating file meta programatically, but an entry is getting added that i did not tell it to write!

$file->update([
	 'title' => $file->id3('title'),
	 'artist' => $file->id3('artist'),
	 'album' => $file->id3('album'),
	 'genre' => $file->id3('genre'),
	 'year'  => $file->id3('year'),
	 'composer' => $file->id3('composer'),
	 'duration' => $file->id3('duration'),
	 'track' => $file->id3('track'),
	 'coverimg' => $cover,
 ]);

But the result is this:

Duration: 6:16

----

Track: 8/10

----

Title: Terminal Frost

----

Album: A Momentary Lapse of Reason

----

Artist: Pink Floyd

----

Composer: David Gilmour

----

Genre: Rock

----

Year: 1987

----

Cover: 

----

Coverimg: 08-terminal-frost-art.jpg

----

Template: audio

Where is the cover: entry coming from? It is not needed and actually its a reserved one i think, since it clashes with an option on images.

#2

Your code shown here does not add it.

Maybe another plugin?
Was a field called Cover in an earlyer version of your plugin? Kirby does not remove unused fieldsfrom a content file.

#3

Is it defined in your file blueprint?

Cover is not a reserved method. There is only a page model in the Starterkit.

#4

Ahem… yes it was… nothing to see here… :blush:

I renamed it in the plugin since i found the clash with the image options, but looks like ive used an older copy of the blueprint before i updated it. Time for some fresh air think…

#5

No but you can set cover: true on image options to effect the way the cards display. I figured it wasn’t a good idea to call mine the same thing.

#6

That is unrelated, you can still call a field cover. The cover setting only refers to how the image is displayed in the Panel.

1 Like