Skip to content

Commit

Permalink
Merge pull request #13556 from craftcms/bugfix/13552-move-element-tar…
Browse files Browse the repository at this point in the history
…get-element-id

Bugfix/13552 move element target element
  • Loading branch information
brandonkelly authored Aug 15, 2023
2 parents c636af6 + 67ff70b commit 6db32ed
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Fixed multiple issues with Selectize inputs.
- Fixed a bug where <kbd>Command</kbd>/<kbd>Ctrl</kbd> + clicks on “New entry” button menu options would open the Entries index page in a new tab, and redirect to the Edit Entry page in the current tab. ([#13550](https://github.com/craftcms/cms/issues/13550))
- Fixed a bug where autosuggest fields weren’t mouse-selectable. ([#13553](https://github.com/craftcms/cms/issues/13553))
- Fixed a bug where `craft\events\MoveElementEvent::$targetElementId` was getting set incorrectly. ([#13552](https://github.com/craftcms/cms/issues/13552))

## 4.5.0-beta.1 - 2023-08-10

Expand Down
1 change: 0 additions & 1 deletion src/events/MoveElementEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public function getTargetElement(): ?ElementInterface
->site('*')
->preferSites([$this->element->siteId])
->status(null)
->status(null)
->drafts(null)
->provisionalDrafts(null)
->revisions(null)
Expand Down
2 changes: 1 addition & 1 deletion src/services/Structures.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ private function _doIt(int $structureId, ElementInterface $element, StructureEle
self::MODE_UPDATE => [self::EVENT_BEFORE_MOVE_ELEMENT, self::EVENT_AFTER_MOVE_ELEMENT],
};

$targetElementId = $targetElementRecord->isRoot() ? null : $targetElementRecord->id;
$targetElementId = $targetElementRecord->isRoot() ? null : $targetElementRecord->elementId;

if ($this->hasEventHandlers($beforeEvent)) {
// Fire a 'beforeInsertElement' or 'beforeMoveElement' event
Expand Down

0 comments on commit 6db32ed

Please sign in to comment.