Hello,
Environment
Drupal 7.36 (multi-site)
Forena 7.x-4.2 installed. Forena Reports and Forena Query Builder enabled.
Windows 7 Professional SP1 64-bit
XAMPP 5.6.3 (Apache 2.4.10 (Win32), MySQL 5.6.21, PhP 5.6.3)
Firefox 37.0.1
I originally enabled Forena in one of the subsites, but to test whether that was the problem, I then enabled Forena in the root site and found the same behavior. What follows is based on working on the root site.
Background
I'm new to Drupal and am converting a set of sites that I wrote in ASP into Drupal. A lot of the content of the ASP sites is tables built from data in Access databases. I have figured out how to import the Access data into MySQL and have done that with the first database for testing. Now the next challenge is how to get Drupal to read that data and make tables from it. I installed the "Views" and "Data" modules, but was frustrated by the difficulty of getting them to read in the data. I found a post about Forena that sounded promising, so I installed that and have been following your doc on using it.
I'm impressed with what Forena can do and if I can get the data access working, I may not even need Views, but may be able to use Forena for all my data display.
The Problem
In "/admin/config/content/forena/data", I defined the data source:
query, Forena queries, sites/all/modules/forena/repos/query
with the other settings left as default for the Drupal driver.
I created the "query" folder and put a copy of "active_users.sql" in it.
However, when I go to "/admin/structure/forena/data", the list of data blocks still only includes those from the three preinstalled "repos" subfolders and does not include the block in the "query" folder.
And when I go to "/admin/structure/forena/data/add", the drop-down box for Data Source only lists the three preinstalled sources and does not include my "Forena queries".
I then tried the alternate method of creating a data source.
In the file "sites/default/settings.php", I put the following code at the end of the file:
global $_forena_repositories;
$_forena_repositories['query2'] = array
('path' => 'sites/all/modules/forena/repos/query2',
'title' => 'Forena queries - 2',
'data provider' => 'FrxDrupal'
);
I created the "query2" folder and put a copy of "active_users.sql" in it.
After saving "settings.php" and going back to "/admin/config/content/forena/data", the data source is listed there:
query2, Forena queries - 2, sites/default/files/Forena/query2
But just as before, the file in "query2" does not show up in the list of data blocks and "Forena queries - 2" does not appear in the Data Source drop-down list.
I also tried the above with the repository folders "sites/default/files/forena/query" and "sites/default/files/forena/query2" and got the same results.
I looked in the Drupal database and found the table "forena_repositories". It has a row with the following data:
query
Forena queries
1
a:7:{s:6:"source";s:4:"user";s:13:"data provider";s:9:"FrxDrupal";s:8:"database";s:7:"default";s:15:"access callback";s:11:"user_access";s:13:"user callback";s:22:"forena_current_user_id";s:4:"path";s:37:"sites/all/modules/forena/repos/query";s:5:"debug";i:0;}
It does not have data2.
Conclusion
So this is a critical problem. Without the ability to create a data block, I can’t move forward with the most important thing I need to do, which is test the ability to connect to the non-Drupal database in MySQL.
Please let me know how to fix this problem or what additional information you need in order to answer that.
Thank you.
Comments
Comment #1
Pierre.Vriens commentedVery well documented issue, great work! But nowhere it says anything about permissions you granted (which makes me believe you might be missing some of the required permissions). So here is an attempt to address that:
Please let us know (via an update to this issue) if this helps, OK?
PS: note that this does rather seem like a support issue to me, so for now I'm updating the issue meta data as such (we can always change it back to bug issue if confirmed to be a bug, ok?).
Comment #2
NewSites commentedHi Pierre,
Thanks for your information, both on Drupal Answers and now here. As I responded on Drupal Answers, you were right about the problem being permissions, so yes this is not a bug, but really a documentation issue.
I said in my response on Drupal Answers that there were five items in Drupal's list of Forena permissions that were not granted to anyone. I see now that all five relate to data sources I created in Forena during my attempts at troubleshooting. The doc on data sources (/reports/help.data) has a lot about permissions. It's pretty complicated and I haven't figured it out yet. But I guess something I know now is that after creating a data source, I have to go to the permissions page and grant myself permission to access it. Is that right, or does that indicate that I'm doing something wrong?
Also, I don't see a way to delete a data source. One data source disappeared from the list (/admin/config/content/forena/data) when I removed its definition from "settings.php". The others are listed in the MySQL table "forena_repositories". Can I safely delete those data sources by simply deleting their rows from that table?
Thanks again for your help. I'm glad to see that it looks like I'll be able to use this module.
Comment #3
metzlerd commentedSome data sources are provided and part of forena and are provided via code and cannot be deleted, but custom created ones can be. Note that they can also be disabled, if you prefer (all data sources can be disabled).
Comment #4
NewSites commentedComment #5
metzlerd commentedUser has indicated in another channel that he is no longer using forena.