Skip to content

Backend item "save as copy" does not copy the "file" field contents over. #862

Answered by TLWebdesign
TLWebdesign asked this question in Q&A
Discussion options

You must be logged in to vote

Ok i figured it out. it needs some logic to check if the task is save2copy and then get the value from the original database and pass that as the data. There already is similar code to this in the save method by default. Unfortunately we can't just add one line to that code so i had to do another call to the database for this.

		if ($input->get('task') === 'save2copy')
		{
			$origTable = clone $this->getTable();
			$origTable->load($input->getInt('id'));

			$data['photo'] == $origTable->photo;
		}

Replies: 1 comment

Comment options

TLWebdesign
Feb 3, 2022
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by TLWebdesign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant