Jump to content

[BUG 4.6.12] Wrong image field name when cloning Package Groups in Commerce


Recommended Posts

This code below is from applications/nexus/sources/Package/Group.php (lines 348-379):

//<?php
	/**
	 * [ActiveRecord] Duplicate
	 *
	 * @return	void
	 */
	public function __clone()
	{
		if ( $this->skipCloneDuplication === TRUE )
		{
			return;
		}

		$oldImage = $this->image;

		parent::__clone();

		if ( $oldImage )
		{
			try
			{
				$icon = \IPS\File::get( 'nexus_PackageGroups', $oldImage );
				$newIcon = \IPS\File::create( 'nexus_PackageGroups', $icon->originalFilename, $icon->contents() );
				$this->image = (string) $newIcon;
			}
			catch ( \Exception $e )
			{
				$this->pg_image = NULL;
			}

			$this->save();
		}
	}

 

The name inside the catch is wrongly using the db table prefix pg_ and should be removed:

$this->image = NULL;

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...