From 528060a1a968b640447eac128030a8ba60816dd6 Mon Sep 17 00:00:00 2001
From: David Balch <david.balch@conted.ox.ac.uk>
Date: Mon, 28 May 2018 12:42:16 +0800
Subject: [PATCH 1/2] MDL-57742 core_lib: Make tool_consumer_instance_guid
 optional

In the specification, tool_consumer_instance_guid is only listed
as recommended. However, the library was requiring it.

https://www.imsglobal.org/specs/ltiv2p0/implementation-guide#toc-42
---
 lib/ltiprovider/src/ToolProvider/ToolProvider.php | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/ltiprovider/src/ToolProvider/ToolProvider.php b/lib/ltiprovider/src/ToolProvider/ToolProvider.php
index 27cbd6e4bb0..8994eff13ab 100644
--- a/lib/ltiprovider/src/ToolProvider/ToolProvider.php
+++ b/lib/ltiprovider/src/ToolProvider/ToolProvider.php
@@ -808,11 +808,6 @@ EOD;
                         if (!$this->ok) {
                             $this->reason = 'Request is from an invalid tool consumer.';
                         }
-                    } else {
-                        $this->ok = isset($_POST['tool_consumer_instance_guid']);
-                        if (!$this->ok) {
-                            $this->reason = 'A tool consumer GUID must be included in the launch request.';
-                        }
                     }
                 }
                 if ($this->ok) {

From 6d32804f8a742d30b7e456867a7c6962cd832a5d Mon Sep 17 00:00:00 2001
From: Mark Nelson <markn@moodle.com>
Date: Mon, 28 May 2018 12:53:26 +0800
Subject: [PATCH 2/2] MDL-57742 core_lib: Updated readme_moodle.txt

---
 lib/ltiprovider/readme_moodle.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/ltiprovider/readme_moodle.txt b/lib/ltiprovider/readme_moodle.txt
index d36fe171d38..9b3b1b8a926 100644
--- a/lib/ltiprovider/readme_moodle.txt
+++ b/lib/ltiprovider/readme_moodle.txt
@@ -5,9 +5,11 @@ Some changes from the upstream version have been made:
 * Define consumer profile member variable for ToolConsumer class
 * Added context type property for Context class
 * Set context type if 'context_type' parameter was submitted through POST
-These changes can be reverted once the following pull requests have been integrated upstream:
+* Do not require tool_consumer_instance_guid
+These changes can be reverted once the following pull requests/issues have been integrated upstream:
 * https://github.com/IMSGlobal/LTI-Tool-Provider-Library-PHP/pull/10/commits/a9a1641f1a593eba4638133245c21d9ad47d8680
 * https://github.com/IMSGlobal/LTI-Tool-Provider-Library-PHP/pull/11/commits/0bae60389bd020a02be5554516b86336e651e237
+* https://github.com/IMSGlobal/LTI-Tool-Provider-Library-PHP/issues/19
 
 It is recommended by upstream to install depdencies via composer - but the composer installation is bundled
 with an autoloader so it's better to do it manually.