Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I want to create a view which will list the node titles which are in a specific queue.
In the fields I have added the node title,
In filter I have added the content in queue -> Yes
In relationship I have added entityqueue_relationship
But when I try to save the I view it gives me the following error.
Array
(
[%type] => Notice
[!message] => Undefined index: table
[%function] => Drupal\views\Plugin\views\relationship\RelationshipPluginBase->calculateDependencies()
[%file] => /[path to drupal]/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
[%line] => 181
)
Comment | File | Size | Author |
---|---|---|---|
#31 | 2643928-29.patch | 475 bytes | amateescu |
#27 | 2643928-27-dev.patch | 6.2 KB | amateescu |
#26 | 2643928.patch | 6.12 KB | amateescu |
#6 | exported_view.txt | 5.56 KB | hmdnawaz |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThis could have been caused by a similar problem with queues and Views (#2645060: Newly added entity queues are not getting listed under relationship in views). Can you please try again with the latest -dev version?
That fix should be available in a few hours in the 8.x-1.x-dev archive or right away if you're using a git checkout of the module repository.
Comment #3
hmdnawaz CreditAttribution: hmdnawaz commentedDownloaded the latest dev version and test with it but same problem exist.
Also tried the
git clone --branch 8.x-1.x https://git.drupal.org/project/entityqueue.git
as in versions control of the module there is only one branch for D8 which 8.x-1.x but same resultsComment #4
hmdnawaz CreditAttribution: hmdnawaz commentedComment #5
amateescu CreditAttribution: amateescu commentedThanks for testing again. I tried to reproduce the problem and I can save a view without any errors..
Can you please try to debug a bit more locally? You can put a
debug($table_data);
in\Drupal\views\Plugin\views\relationship\RelationshipPluginBase::calculateDependencies()
on line 180 (just before thereturn
statement) and maybe post the output here.And maybe export the view as a single config file and post it as an attachement here as well.
Comment #6
hmdnawaz CreditAttribution: hmdnawaz commentedWhen I try to
print_r($table_data)
on line 180 before the return statement, it gives me an empty array.And the exported view is attached.
Comment #7
amateescu CreditAttribution: amateescu commentedHow about a
print_r($this->definition['base'])
? So we can at least find out what table data it's looking for :)Comment #8
amateescu CreditAttribution: amateescu commentedOh wait, it seems that your view does not actually have a relationship to an entity queue...
That's also what I see locally in the UI after importing your exported config file.
Comment #9
hmdnawaz CreditAttribution: hmdnawaz commentedThe view does not have a relationship because when I add a relationship of entityqueue and then save the view, it can't get save instead it gives an error. therefore there is no relationship in my exported view.
And
print_r($this->definition['base'])
returnsentity_subqueue__items
Comment #10
hmdnawaz CreditAttribution: hmdnawaz commentedMy drupal core version is
8.0.1
Comment #11
amateescu CreditAttribution: amateescu commentedAh, ok, I think I know what the problem is.
It's most likely this core issue #2477899: Multiple valued Base fields won't work in Views and it affects Entityqueue because 'items' is a base field with cardinality > 1.
So we need to fix both #2644088: DefaultTableMapping::getFieldTableName does not report table for fields with dedicated storage and #2477899: Multiple valued Base fields won't work in Views and then come back here and check again..
Comment #12
quindio CreditAttribution: quindio commentedI am trying to replicate my view using a nodeque relationship
from my D6 into my D8 migration and I am having the same
problem when creating the view with an entityque relationship
I get a warning:
In order to sort by the queue position, you need to add the Entityqueue: Queue relationship on View: nodequeue_1 with display: default
Then I create a relationship and I get an error when I tried to save:
Notice: Undefined index: table in Drupal\views\Plugin\views\relationship\RelationshipPluginBase->calculateDependencies() (line 181 of /usr/share/nginx/html/drupal8012015/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php).
Where do I set the "with display: default" for the 1st warning?
Any ideas?
Thanks!!
Comment #13
amateescu CreditAttribution: amateescu as a volunteer commentedThe first warning just says that you need to add the entityqueue relationship, the default display part is not really important :)
Is there any chance you can provide the exact steps that you did, something like: created content type X, added fields X and Y, created the view Z and configured it with options A, B, C, etc?
Without being able to reproduce the problem locally, I can't really help much more than this..
Comment #14
quindio CreditAttribution: quindio commentedHi Ameteescu,
I created an entityque name "Featured Video for Home Page"
for the content type "mobile app news" and a view name nodequeue_1
where I am trying to create the realationship
Perhaps, I am using entityque wrong. I have included 4 screenshots at this location:
entityque files
1- first is the entityque configuration "Edit_Entityque_page"
2- my mobile apps content type "mobile_apps_contenttype"
3- the nodequeue_1 views top part "nodequeue_1_view"
4- the nodequeue_1 views bottom part(sql) "nodequeue_1_view_bottom"
Thanks,
Comment #15
amateescu CreditAttribution: amateescu as a volunteer commentedThanks for the additional info. It seems there are quite a few things configured in there so anything other than a full site export won't help me.
However, can you try to apply two patches to your Drupal installation and check if they solve the problem? The two patches are the ones from #2644088-32: DefaultTableMapping::getFieldTableName does not report table for fields with dedicated storage and #2477899-25: Multiple valued Base fields won't work in Views.
Comment #16
quindio CreditAttribution: quindio commentedAfter patching with
#32
and #25
I added the RELATIONSHIP to teh view and then I tried to save and I got this error:
Thanks
Comment #17
andypostgot the problem with export view, module dependency is exported as "null" instead of entityqueue
Comment #18
andypostAlso testing that under pgsql is sad, but probably needs followup
SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: bigint = character varying LINE 6: ...eue__items_node_field_data ON node_field_data.nid = entity_s... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node_field_data} node_field_data LEFT JOIN {entity_subqueue__items} entity_subqueue__items_node_field_data ON node_field_data.nid = entity_subqueue__items_node_field_data.items_target_id AND entity_subqueue__items_node_field_data.bundle = :views_join_condition_0 WHERE (( (node_field_data.status = :db_condition_placeholder_0) ))) subquery; Array ( [:db_condition_placeholder_0] => 1 [:views_join_condition_0] => test_queue )
Comment #19
mikedotexe CreditAttribution: mikedotexe at Metal Toad commentedI'm also experiencing #17.
This causes the configuration for the view to not be able to import using configuration import.
If I delete the exported line:
then everything works great.
Comment #20
mikedotexe CreditAttribution: mikedotexe as a volunteer commentedHere's an update on some step debugging for this issue.
It seems like it's a caching issue.
I'm comparing this to a required relationship with a taxonomy term.
We end up in core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
Step debugging from there brings us to core/modules/views/src/ViewsData.php
the
cacheGet
call below always returns an empty$data->data
I'm afraid I'm not familiar enough with Drupal 8 caching to understand where this is being set.
Hope this helps maintainers of this module.
Comment #21
afoster CreditAttribution: afoster commentedConfirming I have the same issues from @andypost and @mikedotexe are reporting in #17, #19. Any view using entityqueue relationship and sorting exports a null dependency. Tested in Drupal 8.05 and on simplytest.me which is running 8.06-dev. Also tested Entity Queue alpha-4 and dev.
I'm too haven't managed to track down the issue, but am putting in some errors here incase others are having the issue.
Using Import in the UI
Using Drush CIM
Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization. in [error]
Drupal\Core\Config\ConfigImporter->validate() (line 730 of /website/core/lib/Drupal/Core/Config/ConfigImporter.php).
The import failed due for the following reasons: [error]
Configuration views.view.test_view depends on the module that will not be installed
after import.
Workaround: After Exporting delete the null line
Comment #22
andypostCurrent workaround is to install Null module)
Comment #23
krlucas CreditAttribution: krlucas at Genuine commentedInstalling Null module doesn't help for me. drush cex still exports the view with
instead of
Adding the quotes is no easier than deleting the line as in #21
Comment #24
chrisroane CreditAttribution: chrisroane commentedI can confirm what krlucas said. Installing the null module doesn't fix it. Right now we have to remember to delete the null dependency when we run drush cex and it is really annoying........
Comment #25
balawang CreditAttribution: balawang at CI&T commentedAs having similar issue when creating a install profile...
For what I've done to workaround this is to like #12 said, delete the dependencies - null line, and place the entityqueue.entity_queue.xxxxx.yml to config/optional folder together with views.view.xxxx.yml which has entityqueue relationship.
Comment #26
amateescu CreditAttribution: amateescu as a volunteer commentedI finally managed to reproduce this locally!
Thanks to #2644088: DefaultTableMapping::getFieldTableName does not report table for fields with dedicated storage, which got committed recently, I was able to also discover other problems with our views integration so here's a patch that should make everything work properly with Drupal 8.1.0 and beyond.
Can you please test it and let me know if an upgrade path is needed for existing views? Or if just a cache clear is enough to bring them on track?
Comment #27
amateescu CreditAttribution: amateescu as a volunteer commentedRerolled the patch to take into account another patch that was just committed to 8.x-1.x (#2686623: Empty views cache when queue is updated).
For anyone who wants to test it, the patch in #26 should apply to 8.x-1.0-alpha4 and this one applies to the -dev release.
Comment #28
joachim CreditAttribution: joachim commentedI applied the patch in #26 to my EntityQueue alpha4, did a drush cr, saved my view, and all seems to be working fine.
Previously, my view was actually saving, unlike the initial report here, but I was getting the same error message about RelationshipPluginBase->calculateDependencies().
BTW, between applying the patch and doing a cache clear, I got this fantastic crash when I tried looking at the view page:
Drupal\Core\Database\DatabaseExceptionWrapper: Exception in Resources[resources]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON resource.id = . INNER JOIN entity_subqueue__items _resource ON entity_id = _r' at line 1: SELECT resource.id AS id, delta AS delta FROM {resource} resource INNER JOIN {} ON resource.id = . INNER JOIN {entity_subqueue__items} _resource ON entity_id = _resource.items_target_id ORDER BY delta ASC; Array ( ) in Drupal\views\Plugin\views\query\Sql->execute() (line 1457 of core/modules/views/src/Plugin/views/query/Sql.php).
That went away once caches were cleared :)
Comment #31
amateescu CreditAttribution: amateescu as a volunteer commentedThanks @joachim for testing :) I committed the patch from #27 along with this small followup that just provides an empty update function, for those who forget to clear the cache.
I'm going to hold off releasing alpha5 for a few days just so we can get a few more confirmations that we didn't break something else with this patch.
Comment #32
GrimreaperHello,
Thanks for the patches.
After drush updb, I resaved my view just in case. No more diff in Features that show a "null" module in dependencies.
Comment #34
SanderJP CreditAttribution: SanderJP commented@amateescu when do you think alpha5 will be released? A few days turned into a few months ;)
Comment #35
ibuildit CreditAttribution: ibuildit commentedconfirming dev version works after I save the view again