Page 1 of 2

Diary as Module does not read data

Posted: Wed 04 Dec 2024 8:14 pm
by Dador
I have installed CMX 4.3 and Cutils 7.3. Basically everything works fine.
I used the new diary function as a module. The file diary.txt and the files diary20xx.txt have been created. They were sent automatically to the server. I created a new page diary.php, where, as always, it invokes the action with a command.

Code: Select all

<?php include('diary.txt');?>
The menu loads, but the tables in the diary20xx.txt files do not load.
I have the diary.php file in the main directory, and the diary.txt and diary20xx.txt files in another directory intended for Cutils. Could this be the reason why the files are not loading?

https://pogodarybnik.pl/diary.php

Re: Diary as Module does not read data

Posted: Wed 04 Dec 2024 8:25 pm
by HansR
Dador wrote: Wed 04 Dec 2024 8:14 pm The menu loads, but the tables in the diary20xx.txt files do not load.
I have the diary.php file in the main directory, and the diary.txt and diary20xx.txt files in another directory intended for Cutils. Could this be the reason why the files are not loading?
Yes that is the issue. It is a kind of reversed CumulusRealTimeLocation issue.

Normally CUtils looks for datafiles in the CUtils directory only for CMX datafiles which get a dir specification CumulusRealTimeLocation. With you it is inversed. For the diary you want the diary files to load in the expected current directory but they are still in the CUtils directory.

The invocation of PHP in the main directory (your webroot) is not valid for CUtils (understandably).

I have to think about this one.

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 4:10 am
by HansR
HansR wrote: Wed 04 Dec 2024 8:25 pm I have to think about this one.
@Dador: could you specify:
  1. What technique do you use for upload (FTP or PHP or etc...)
  2. if PHP: where - in which directory - the upload.php is
  3. Could you give me the value of the parameter section FTP site / UploadDir in cumulusutils.ini?

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 5:59 am
by Dador
HansR wrote: Thu 05 Dec 2024 4:10 am @Dador: could you specify:
  1. What technique do you use for upload (FTP or PHP or etc...)
  2. if PHP: where - in which directory - the upload.php is
  3. Could you give me the value of the parameter section FTP site / UploadDir in cumulusutils.ini?
Ad 1 - FTP
Ad 2 - ----
Ad 3 -

Code: Select all

[FTP site]
FtpLog=false
DoUploadFTP=true
UploadDir=/domains/pogodarybnik.pl/public_html/CU/

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 9:25 am
by HansR
Dador wrote: Thu 05 Dec 2024 5:59 am Ad 1 - FTP
Ad 2 - ----
Ad 3 -

Code: Select all

[FTP site]
FtpLog=false
DoUploadFTP=true
UploadDir=/domains/pogodarybnik.pl/public_html/CU/
Thanks, I will see what I can do and get back to this ASAP.

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 1:48 pm
by HansR
OK. I solved this problem long ago apparently: see the wiki page on Modules and the inifile parameters which go with it (section general).

I will have to create the code for that in the Diary module though so expect version 7.3.1 soon.
Your ModulePath than must be: ./CU/.

Re: CustomLogs as module

Posted: Thu 05 Dec 2024 2:11 pm
by HansR
Attached your will find the required new files for 7.3.1 beta 1 to use Diary as a module where the CU directory on the server is not the main website directory.

Please set (see: wiki for Module, section [General] ):

Code: Select all

DoModular=true
ModulePath=<path>
Let me know how you get on.
When successful I'll release 7.3.1

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 7:57 pm
by Dador
From the very beginning of using various modules, I have had these settings.

Code: Select all

DoModular=true
ModulePath=./CU/
Unfortunately, version 7.3.1 didn't change anything for me. The table still does not load.

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 8:13 pm
by HansR
Well, it has been improved because the Diary now uses the ModulePath which it did not before.

The console now tells me it does not know urlParams (See here for the wiki page). You must have taken precautions for this one before. But if you did not, best is to declare globally

Code: Select all

<script>
  const urlParams = new URLSearchParams(window.location.search);
</script>

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 8:24 pm
by Dador
HansR wrote: Thu 05 Dec 2024 8:13 pm Well, it has been improved because the Diary now uses the ModulePath which it did not before.

The console now tells me it does not know urlParams (See here for the wiki page). You must have taken precautions for this one before. But if you did not, best is to declare globally

Code: Select all

<script>
  const urlParams = new URLSearchParams(window.location.search);
</script>
Ah, ok.
Really. With one of the previous modules, I also had to introduce this script to the website. Now I remember something. :bash:
Thank you, that helped.

One more request.
Could you add a translation for

Code: Select all

TableView
ChartView

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 8:29 pm
by HansR
Dador wrote: Thu 05 Dec 2024 8:24 pm One more request.
Could you add a translation for

Code: Select all

TableView
ChartView
OK. Coming up in the formal 4.3.1 release, probably tomorrow (waiting for @sutne's feedback on 4.3.1)
Will be in section Diary.

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 8:40 pm
by HansR
@Dador: btw you do not have a chartview. I guess we need to look there?
It says: Highcharts not defined (you you miss the includes). Also see the wiki

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 8:43 pm
by sutne
waiting for @sutne's feedback on 4.3.1
I am travelling at the moment. Will not be home until friday evening.

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 8:49 pm
by HansR
sutne wrote: Thu 05 Dec 2024 8:43 pm
waiting for @sutne's feedback on 4.3.1
I am travelling at the moment. Will not be home until friday evening.
Thanks for telling me, we will wait. The world will no go under without the update. Stay safe.

Re: Diary as Module does not read data

Posted: Thu 05 Dec 2024 8:54 pm
by Dador
HansR wrote: Thu 05 Dec 2024 8:40 pm @Dador: btw you do not have a chartview. I guess we need to look there?
It says: Highcharts not defined (you you miss the includes). Also see the wiki

I've already figured it out.

Works perfecto :D