Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Bug in Messages.php #77

@benhaynes

Description

@benhaynes

From directus created by WeeRuz : directus/directus#2200

Version Info

  • Directus version and branch (Or commit hash): 6.4.9
  • PHP version: 7.0.32
  • MySQL version: 5.7.23-cll-lve
  • Web server: Apache 2.4.34
  • OS name and version: Linux 3.10.0-714.10.2.lve1.5.15.el7.x86_64

Expected Behavior

GET api/1.1/messages/rows/1 should return message with ID 1

Actual Behavior

Returns "Message not found"

Steps to Reproduce

  1. Create a message in the admin
  2. Make a get or go to api/1.1/messages/rows/[id] where [id] is the id of your newly created message

Fix

I found the bug and fix in the source code. In api/routes/A1/Messages.php row 104 there is an unused variable: $result.
Change this to $message, $message seems to be the right variable, judging from the code below.

api/1.1/messages/rows/1 now returns expected message.

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions