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.
Problem/Motivation
1: Create a new report.
2: Add some datas, even just one is enough.
3: Go to the "layout" tab, modify the layout (I added an <h2>
before the table).
4: Save.
5: Go back to data, it's now empty!
It happens everytime I try to change the layout, which makes the module unsuable.
If it helps, I use CKEditor as a WYSIWYG.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#9 | forena_paramters_error.patch | 528 bytes | metzlerd |
Comments
Comment #1
Growiel CreditAttribution: Growiel commentedComment #2
metzlerd CreditAttribution: metzlerd commentedCKEditer is stripping the .frx attributes from the html and also stripping the id attributes from the html. You will probably need to set the allowedContent option on CKEditor to make sure it at least does not strip out id attribues. IF the id attributes are not removed forena will put the .frx attributes back on the appropriate elements after saving, but it cannot do this if CKEditor is configured to strip id attributes from the html.
Comment #3
metzlerd CreditAttribution: metzlerd commentedComment #4
Growiel CreditAttribution: Growiel commentedHi,
Thanks for your answer.
I checked my source, it looks like the ids are here, but I still loose my datas.
This is what I have with the "source" button of CKEditor:
Another weird thing is that when the data blocks are removed, the associated parameters are NOT removed and when I try to add the same datablock I get a fatal error:
Exception: DateTime::__construct() expects parameter 1 to be string, array given in DateTime->__construct() (line 528 of /modules/forena/FrxDataSource.inc).
I have to remove the parameters to be able to re-add my datablock.
In the same way, I can't seem to add two reports using the same parameters. I also get the above fatal error. I want to have a page with multiple reports but all using the same "start" and "end" dates.
Should I open a new issue for the second thing ?
Thanks!
Comment #5
metzlerd CreditAttribution: metzlerd commentedWRT the parmaters. I wouldn't expect them to be removed as they are not in the content of the report. The wysiwyg ediors strip off all frx: attributes, which is somewhat to be expected. They don't get put back on until the save operation. So you'd have to take a look at the source file to verify what the final reprot should look like if the ID's are being stripped off by the wysiwyg editor.
Hmm... Are you using the latest version of the dev-snapshot? I'm a bit curious about version. The bugs that you are reporting are bit remenicent of some older bugs that have been fixed. We can leave this as one issue until we know they are separate.
Lets try disabling CKEDITOR temporarily just to make sure that we understand what the two problems are.
Comment #6
Growiel CreditAttribution: Growiel commentedI arrived to the same conclusion, so I don't edit the layouts via Drupal's Inteface anymore, I edit the .frx files in my IDE.
Is there any known drawbacks / limitations to editing the layouts files vs editing via Drupal ?
I kind of like the idea of editing the files as I can then setup Git versionning on them.
According the .info, i'm using version 7.x-3.12+7-dev .
I can understand the parameters not being removed, but I should be able to a new datablock using the same parameters.
Comment #7
metzlerd CreditAttribution: metzlerd commentedYes, you should. There are no real drawbacks to using the IDE. All features available in the ui can also be leveraged in the .frx files directly. The only minor drawback is that if you change certain things in the .frx file (menus, preport titles or categories) you may need to visit the structure forena page to clear the cache to see those changes in your menu or in the My Reports pages. (You can also do this with a drush command "drush frxcc". I will try and reproduce this behavior but it may be something about the data blocks that you're adding. Does it matter what order they are added? Or is it perhaps a problem with all data blocks? For example, try adding the same data block twice... do you still get the error?
I usually start the reports with drupal, then alter them by directly editing the .frx file. Yes versioning them is particularly useful. The 7.x-4.x version will have some improved support for module provided .frx files that can be delivered as part of a custom module. (but of course you'll still be able to just have them live in your sites/default/files/reports directory if you prefer.
Anyway, I'll try and work on reproducing this bug later on today and post my results here.
Comment #8
Growiel CreditAttribution: Growiel commentedI'm using the same process: create the report in Drupal, add the datablocks via the interface and just edit the HTML template in the frx file.
In case it helps, here's my data block. If i add it twice, the problem still exists:
As long as the parameters are already present before I import a datablock with the SAME parameters (haven't tried with different ones) it generates the error.
To reproduce:
1: Add the datablock in a brand new report with parameters left blank.
2: Try to add the datablock again -> error.
Thanks a lot for your time, I appreciate it!
Comment #9
metzlerd CreditAttribution: metzlerd commentedThanks ,
Was able to reproduce problem. I'm attaching a patch that will be ready in the next build. It has already been committed and pushed. But here it is in case you would like to manually apply and test.
Comment #10
Growiel CreditAttribution: Growiel commentedThis is working great, thanks !
Comment #11
Growiel CreditAttribution: Growiel commentedComment #12
metzlerd CreditAttribution: metzlerd commentedThanks for the testing.
Comment #13
metzlerd CreditAttribution: metzlerd commented