Bug #30312

Entity class name is not properly detected in Repository::__construct()

Added by Bastian Waidelich almost 4 years ago. Updated over 3 years ago.

Status:Resolved Start date:2011-09-27
Priority:Should have Due date:
Assigned To:Thomas Hempel % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0.1
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.0

Description

If a package key contains the string "Repository", model class names are not correctly resolved in the Repository constructor because the line:

$this->entityClassName = str_replace(array('\\Repository\\', 'Repository'), array('\\Model\\', ''), get_class($this));

fails to detect the correct position of the substring and should be replaced by something like:
$this->entityClassName = preg_replace(array('/\\Repository\\/', '/Repository$/'), array('\\Model\\', ''), get_class($this));

See #30306

Associated revisions

Revision 2f5d0cbd
Added by Thomas Hempel over 3 years ago

[BUGFIX] Enhance entity classname detection in repository constructor

Fix bug where all occurrences of the word "Repository" were stripped
out during the automatic retrieval of the entity classname. This changes
the behavior in the way, that only removes the last occurrence.

Change-Id: I9698f905edfc038d9a618ae1462da0e0e540c0c2
Fixes: #30312
Releases: 1.0, 1.1

Revision 68589076
Added by Thomas Hempel over 3 years ago

[BUGFIX] Enhance entity classname detection in repository constructor

Fix bug where all occurrences of the word "Repository" were stripped
out during the automatic retrieval of the entity classname. This changes
the behavior in the way, that only removes the last occurrence.

Change-Id: I32a33fd5500f202f184c255d588cb073596a2b35
Fixes: #30312
Releases: 1.0, 1.1

History

#1 Updated by Karsten Dambekalns almost 4 years ago

  • Affected Flow version set to FLOW3 1.0.0

#2 Updated by Mr. Hudson almost 4 years ago

  • Status changed from New to Under Review

Patch set 1 of change I9698f905edfc038d9a618ae1462da0e0e540c0c2 has been pushed to the review server.
It is available at http://review.typo3.org/6514

#3 Updated by Mr. Hudson almost 4 years ago

Patch set 2 of change I9698f905edfc038d9a618ae1462da0e0e540c0c2 has been pushed to the review server.
It is available at http://review.typo3.org/6514

#4 Updated by Karsten Dambekalns over 3 years ago

  • Assigned To set to Thomas Hempel
  • Target version set to 1.0.1
  • Has patch set to No

#5 Updated by Mr. Hudson over 3 years ago

Patch set 3 of change I9698f905edfc038d9a618ae1462da0e0e540c0c2 has been pushed to the review server.
It is available at http://review.typo3.org/6514

#6 Updated by Thomas Hempel over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF