Open abbydrury opened 2 years ago
Hello @abbydrury
I has been created another release could try to version 8.1.2 https://github.com/ebsco/edsapi-drupal-plugin/releases/tag/8.1.2
Also you can clone from a specific branch. git clone --branch edsapi-drupal8-release git@github.com:ebsco/edsapi-drupal-plugin.git
Thank you.
Two things:
The errors are
Are you also seeing these errors when you test?
Hello @abbydrury
Please, could you send a email with yours specific environments?
Send a email to me kanthony at ebsco dot com.
Thank you.
I guess I'm not sure what you're asking for. We're running Drupal 8.9.19. My development environment is Mac OS X 10.15.7, using Lando's (version 3.3.2) Pantheon recipe for Drupal 8 - Lando is a tool that helps manage Docker-based development environments, and was Pantheon's tool of choice for development when we created this site. We manage Drupal packages with Composer for cross-environment portability.
I don't know why the environment would matter in this case though. I haven't looked deeply at this, but $token
, $timeout
, $autocompleteUrl
, $autoToken
, and $autoCustId
don't get set if you end up in the else
condition at line 146 of EBSCOAPI.php
. I don't know what's going on exactly with IncludeImageQuickViewOption
in ESBSCOResponse.php
, but I'm guessing $this->response->AvailableIncludeImageQuickView->IncludeImageQuickViewOptions
returned null
- that would cause an inability to read the final property in $this->response->AvailableIncludeImageQuickView->IncludeImageQuickViewOptions->IncludeImageQuickViewOption
.
Something changes on Drupal 8.9.19 core. I'm abble to see the issue now! i'll working on it. Thank you.
Hello,
The version 8 is okay now from my end
Could you try this way?
git clone --branch edsapi-drupal8-release git@github.com:ebsco/edsapi-drupal-plugin.git
We still have a warning but i'm check, probably it is something from drupal core and not the app itself.
Thank you.
I can't get this to work, even using the "standard" install option to create a brand-new instance of Drupal 8.9.19 and cloning the EBSCO module with git clone --branch edsapi-drupal8-release git@github.com:ebsco/edsapi-drupal-plugin.git
:
That's clearly not correct:
With the same configuration values in version 0.2 of the module, we do get the correct results even with our custom code to tweak the display surrounding it (the ESBCO results are the center "Library materials" column):
I do see this error in dblog. It does look like it's from core, and it looks like the value it's having trouble with is "autocomplete". It might be coincidental, but that is one of the API fields - is it possible that there's a string object somewhere that should be part of an array instead?
Warning: array_merge(): Expected parameter 1 to be an array, string given in Drupal\Core\Render\Element\RenderElement::setAttributes() (line 134 of /app/drupal-8.9.19/core/lib/Drupal/Core/Render/Element/RenderElement.php)
#0 /app/drupal-8.9.19/core/includes/bootstrap.inc(600): _drupal_error_handler_real(2, 'array_merge(): ...', '/app/drupal-8.9...', 134, Array)
#1 [internal function]: _drupal_error_handler(2, 'array_merge(): ...', '/app/drupal-8.9...', 134, Array)
#2 /app/drupal-8.9.19/core/lib/Drupal/Core/Render/Element/RenderElement.php(134): array_merge('autocomplete', Array)
#3 /app/drupal-8.9.19/core/lib/Drupal/Core/Render/Element/Textfield.php(101): Drupal\Core\Render\Element\RenderElement::setAttributes(Array, Array)
#4 [internal function]: Drupal\Core\Render\Element\Textfield::preRenderTextfield(Array)
#5 /app/drupal-8.9.19/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(100): call_user_func_array(Array, Array)
#6 /app/drupal-8.9.19/core/lib/Drupal/Core/Render/Renderer.php(781): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'silenced_deprec...', 'Drupal\\Core\\Ren...')
....
Or, are there additional or different configuration expectations/values in this newer version of the module?
Do you clean the drupal cache after installation and the cookies and cache from the browser?
I can see some warning from the drupal core but there are nothing regards to the app.
Version Drupal 8.9.19.
Yes, I cleared the Drupal cache and the browser cache.
Hi, I’m working on the same codebase as @abbydrury .
You still have not fixed the deprecated call to create_function
mentioned in issue #22 . A fix was merged then overwritten. Here’s a patch rolled against v8.1.3:
diff --git a/ebsco.module b/ebsco.module
index 3a6cb52..ebd727a 100755
--- a/ebsco.module
+++ b/ebsco.module
@@ -1741,10 +1741,9 @@ function auto_link($string)
{
$linkedString = preg_replace_callback(
"/\b(https?):\/\/([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*)\b/i",
- create_function(
- '$matches',
- 'return "<a href=\'".($matches[0])."\'>".($matches[0])."</a>";'
- ),
+ function ($matches) {
+ return "<a href='".($matches[0])."'>".($matches[0])."</a>";
+ },
$string
);
Abby did some more digging and found that the EBSCOConnector->request()
function was throwing an exception for “Invalid argument value” relating to includeimagequickview
. We were passing false
, which I think is the default. I tried removing it entirely (commented out line 561 in EBSCOAPI.php), since it’s also set at line 584 if it’s true, and I get results now.
In chasing that, I noticed the EBSCOAPI->handleError()
function has comments like it’s intending to display something to the user, but it does not; that case
is falling through to the default. Either way, it wouldn’t be a terrible idea to log an actual error message so administrators can see what’s going on, using something like
\Drupal::logger('my_module')->error($message);
When I try to render the results, the module logs this for each entry in the result set:
Warning: Invalid argument supplied for foreach() in EBSCOResponse->buildRetrieve() (line 773 of /app/web/modules/contrib/edsapi-drupal-plugin/lib/EBSCOResponse.php)
Changing line 771 to this removes the problem:
if ($record->IllustrationInfo && $record->IllustrationInfo->Images) {
Two more updates:
We're running Drupal 8.9.19 and are attempting to upgrade from v0.2 of this module to v8.1.1 of this module. When I execute a search in v8.1.1 that previously worked in v0.2, the search fails and I get a pile of errors (I think 36 for every query). The first one is this:
Here is the summary list of them all:
![dblog-2](https://user-images.githubusercontent.com/48217815/136090208-56272e85-5cdd-4e57-8a99-e154297fc413.png)
Please help!