-
Posts
104 -
Joined
-
Last visited
-
Days Won
3
TomPich last won the day on September 15 2024
TomPich had the most liked content!
About TomPich
- Birthday 02/26/1976
Contact Methods
-
Website URL
https://www.situp-webcreation.com
Profile Information
-
Gender
Male
-
Location
Strasbourg
Recent Profile Visitors
3,852 profile views
TomPich's Achievements
Sr. Member (5/6)
85
Reputation
-
Hello, Why don’t you just move the files and the database? You don’t need to make a fresh install. Unlike WordPress, the database can be moved as it is. Then you have to change the DB config in the /site/config.php file. Be sure to check if the old version of PW works with the new PHP version.
-
Any way to access $languages API var inside Page Class?
TomPich replied to TomPich's topic in General Support
Thanks, but unfortunately, I tried these before asking, because it seemed logical. All of this return NULL. But it seems it’s because I try to do this in the constructor. It’s apparently too early for that. When I do that in a method, it works. So maybe combined with a hook, I can acheive what I want. class HomePage extends DefaultPage { public function __construct(Template $tpl = null) { parent::__construct($tpl); $this->lang1 = $this->languages; // NULL $this->lang2 = wire()->languages; // NULL $this->lang3 = wire('languages'); // NULL } public function lang(){ return $this->languages; // NULL return wire()->languages->getLanguage()->name; // works! return wire('languages')->getLanguage()->name; // works! } } -
Hello, I was wondering if there is a way to access the $language variable inside my DefaultPage class. I’d like, inside this class to define a lang property, rather then in the page template. public function __construct(Template $tpl = null) { parent::__construct($tpl); $this->lang = $languages->getLanguage; // doesn’t work, $languages is not accessible inside the class } Thanks
-
Oh, that’s interesting... I didn’t know about that. I will try ASAP. Thank you so much, Bernhard!
-
OK, so it’s not Stripe. Every now and then, specialy in the middle of the night, I have the following exceptions logged: 2024-11-24 01:25:55 ? ? Unable to load Modules - SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (in /wire/core/WireDatabasePDO.php line 505) 2024-11-24 01:25:55 ? ? SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (in /wire/core/WireDatabasePDO.php line 505) Somehow, PW wants to use the local db credencial, even though it’s the online website. No error has been reported by my client, and I can’t see no error neither. Any clues about what this is about? Any help would be really appreciated. Thanks
-
Hi, Updating CSS – Processwire let you handle CSS the way you want directly in file(s). So yes, you will have to manually edit the CSS. I cannot help you with Form Builder specifically, as I don’t use it. But the general behaviour of PW with form is the same as default behaviour: if not specified otherwise, a form will send the form data with GET to the current URL when you press submit. So you have to check what method is used on your form (GET or POST) and to which URL the data are sent. With the elements you provided, I would say the data are sent with JS by fetch. So try to locate the script that handle this to see what happen when the form is submitted. When you know where your data are sent, there is two possibilities: • either it’s a existing page, so get the template php file of the corresponding page, and you see what happens with the data. • or (more probably in your situation, as it seems to be a JS submit), it’s an endpoint that has been created via a hook (check your init.php file in the site folder) to handle the data. Hope this helps.
-
Incorrect structure: “}” or name of the object member is missing
TomPich replied to kaz's topic in Getting Started
Do you use structured data in your website? If you get no error but google tells you that, it’s the only cause I can think of now. If so, you can check their validity here: https://developers.google.com/search/docs/appearance/structured-data -
I think I got it. I use Stripe on this website. And to confirm webhook, there is a POST request sent by Strip to confirm payment. When I do a test on the local website, Stripe sends the request to the online website, but with a reference to the local url... So PW cache is not involved here, I guess...
-
That’s my point. When using webpack on a website, you have to map the includes with the corresponding node_module folders. It does not find them automatically. That has to be done in the webpack.config.js. Otherwise (which is the solution I choose), you have to write the full path to the file to include (and the right version of it), something like "../node_module/@fullcalendar/core/index.global.js" or whatever file that provides the final "exports". Hope it will be usefull.
- 17 replies
-
- 1
-
- javascript
- js
-
(and 2 more)
Tagged with:
-
Sorry, maybe a dumb question to ask, but did you configure (resolve path / module to use, babel-loader)? Did you try that specifying the exact location of the files?
- 17 replies
-
- javascript
- js
-
(and 2 more)
Tagged with:
-
Yes, that would be great! Count me in (for Europe !) 😊
-
Hello guys, I have a strange and silent error on a PW website that I cannot figure out. It happens only online (not in local). It’s a database connexion error, and I never saw it on the website, it just appears in the logs. On localhost, the url is mfw-ut-inscription-2024. It’s a different one online, of course. I have my credentials for databases (internal and external databases) in config.php, which look like: // PW database if ( in_array($_SERVER["HTTP_HOST"], ["my-distant-website.com"])) { $config->dbName = 'xxx'; $config->dbUser = 'xxx'; $config->dbPass = 'xxx'; } else { $config->dbName = 'xxx'; $config->dbUser = 'root'; $config->dbPass = ''; } // External database if ( in_array($_SERVER["HTTP_HOST"], ["my-distant-website.com"])) { $config->gestiondbName = 'xxx'; $config->gestiondbUser = 'xxx'; $config->gestiondbPass = 'xxx'; } else { $config->gestiondbName = 'xxx'; $config->gestiondbUser = 'root'; $config->gestiondbPass = ''; } Everything works perfectly. But every day, I get new errors logged in the errors.txt log file (from the online website). 2024-11-10 12:41:56 ? https://mfw-ut-inscription-2024/ Error: Exception: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (in /home/joko4944/domains/staging.ut-inscription.com/wire/core/WireDatabasePDO.php line 505) #0 /home/joko4944/domains/staging.ut-inscription.com/wire/core/WireDatabasePDO.php(505): PDO->__construct() #1 /home/joko4944/domains/staging.ut-inscription.com/wire/core/WireDatabasePDO.php(872): ProcessWire\WireDatabasePDO->pdoWriter() #2 /home/joko4944/domains/staging.ut-inscription.com/wire/core/WireSaveableItems.php(219): ProcessWire\WireDatabasePDO->prepare() #3 /home/joko4944/domains/staging.ut-inscription.com/wire/core/Wire.php(416): ProcessWire\WireSaveableItems->___load() #4 /home/joko4944/domains/staging.ut-inscription.com/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod() #5 /home/joko4944/domains/staging.ut-inscription.com/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks() #6 /home/joko4944/domains/staging.ut-inscription.com/wire/core/Fields.php(285): ProcessWire\Wire->__call() #7 /home/joko4944/domains/staging.ut-inscription.com/wire/core/Fields.php(172): ProcessWire\Fields->getWireArray() #8 /home/joko4944/domains/staging.ut-inscription.com/wire/core/ProcessWire.php(625): ProcessWire\Fields->init() #9 /home/joko4944/domains/staging.ut-inscription.com/wire/core/ProcessWire.php(578): ProcessWire\ProcessWire->initVar() #10 /home/joko4944/domains/staging.ut-inscription.com/wire/core/ProcessWire.php(315): ProcessWire\ProcessWire->load() #11 /home/joko4944/domains/staging.ut-inscription.com/index.php(52): ProcessWire\ProcessWire->__construct() #12 {main} So that’s very very strange because: (1) the url is *not* the url of the online website (although the errors only show up online). (2) at some point, PW tries to connect to my local databases (and of course it can’t, because it’s online) (3) I never noticed anything wrong on the onine website, nor my client... The local url (mfw-ut-inscription-2024) only appears at 4 places in the website files: Three times in config.php • $config->httpHosts = array('mfw-ut-inscription-2024', "my-distant-website.com"); • twice in something like: if ($_SERVER["HTTP_HOST"] === 'mfw-ut-inscription-2024' ){/* some scret keys for some services */} and one last time in a hook in init.php: $is_local = $this->config->domain === "mfw-ut-inscription-2024"; So I can’t understand how the online website can detect a session @ https://mfw-ut-inscription-2024/. Can this be due to some cache file? I only use the basic cache system of PW and no template is cached. Any clue or advice would be welcome. 😊 Thank you
-
[Solved] How you work with pw on external server
TomPich replied to olivetree's topic in Getting Started
I always install pw locally. Then I use rsync to push and pull modifications, quick and easy. -
Set default description for input field file on load
TomPich replied to TomPich's topic in General Support
Thanks! It works perfectly. I didn’t know about the "pageFile" argument. I wonder where I could have find this 😅