-
Posts
405 -
Joined
-
Last visited
-
Days Won
5
Everything posted by da²
-
This gives the same error. I fill this is related with the module because this is not the first time I bootstrap PW and never had an issue before to install this module. You are using REQUEST_URI, but when bootstrapping, isn't it expected that it's not defined? It's easy to test, just include PW index.php in any script and run it directly (no web page involved).
-
Another question/issue. I'm starting a new project, it will include bootstrapping code. I made a simple test, and I get an error from FrontendForms, error comes from the include of index.php. The test script: <?php namespace ProcessWire; include __DIR__ . "/../vendor/autoload.php"; include __DIR__ . "/../index.php"; The error: Is it a bug or do I have to do anything to avoid this?
-
Hi, I'm testing your module, thanks for sharing it. 🙂 I'm creating a form to upload a zip file to a temporary directory (wire()->files->tempDir(uniqid())), then I need to open the zip and parse its content, the files will be deleted by PW at the end of the request. There's something I don't understand about file uploading, the file name on server disk is modified so it no longer uses the name given by the form, and it seems it's not using the PW filenames rules. For example: the file name on my disk is "testésim.zip". the form, when using $this->getValue('zipFile') returns "testésim.zip" (the same). but the file on server disk was renamed to "testesim.zip" (no more accent). and the PW sanitizer, wire()->sanitizer->filename($this->getValue('zipFile')), returns "testsim.zip" (totally remove the letter with accent). It looks like FrontendForms is renaming the file with its own rules, and not updating the InputFile field value to reflect the correct name. So what is the way to get the correct file name from FrontendForms? Actually, since the upload is limited to one file, I do a loop on upload directory to find it.
-
Are you observing abnormal RAM usage before the crash? For the past few months, we've been experiencing an issue on a server that hosts several websites. MariaDB has been using more and more memory, and after a few weeks, it reaches the server's limit of 8 GB, causing the Linux kernel to kill processes. This issue started around the same time I installed a new site built with ProcessWire, but I can't say for sure that it's related. We've checked our MariaDB settings, the opened connections status, investigated what we could, but we haven't found the cause yet.
-
Why would the pages of a template be invisible in the non-default language?
da² replied to da²'s topic in API & Templates
What is disturbing me the most is the fact that I'm not finding pages (using Pages API) that are not enabled for the current user language. For example, I have a few templates that are not meant to be translated, so I disabled multi-language management ("Settings tab" in the template). But if user is not using the default language I don't find them. pages()->find('template=foo'); // Need all pages even if not enabled for current user language In Page Names module option, we can avoid the page to show a 404 and make it render in default language, but it's missing the same option using API to find pages (find(), children()...). I see 2 workarounds, not really satisfying: Always enable all languages on every page and template, even if they are not meant to be translated. Set user language to default before every kind of page search. This is too much, and error prone. A global option would be better. Maybe I'm missing another option? -
Just to add to this topic, Page class has a function to enable language, a bit cleaner than using "status$lang": foreach (languages()->findNonDefault() as $language) { $page->setLanguageStatus($language, true); }
- 12 replies
-
- 1
-
-
Why would the pages of a template be invisible in the non-default language?
da² replied to da²'s topic in API & Templates
Thanks, I find this behavior a bit odd and think the option implemented in RockMigrations could be on the core module "Page Names". Creating pages via API doesn't use the same behavior as when using the admin interface, or even when generating pages within an admin hook (all languages are activated by default in these cases). I don't understand why this is different in a hook and when bootstrapping PW. Also, when we add a new language, every existing page is automatically enabled for this language, so why not doing it by default when a new page is created on front-end? Do you know the reasons behind these choices? -
Hello, My site (PW 3.0.240), using multi-language URLs since a few months, has default language french, and another language english. I don't know why, but a specific template is not accessible to english on front-end: If I go to the english URL of one of these pages, I get a 404. If I go to one of this pages in french, the language switcher shows only french as available language. If I display the pages of this template while using english, I get an empty list. I found that I checked in "template > advanced" the option "Disable multi-language support for this template" but: Enabling it again doesn't solve the issue. This option doesn't show a 404, it just switch language to default when loading this page. That was a mistake to check it, but not the cause of this issue (apparently). While writing this post, I investigated more and found the following. I finally found what makes these pages unreachable in english, this in the pages themselves, this checkbox is disabled in Settings tab: These pages are created dynamically, why is this "active" checkbox disabled, is it expected, and how to enable it automatically? This is more serious than it looks, because it ends with important bugs in the site and database inconsistencies. The problematic template represents a team in a competition. When a user using english language registers to a championship and creates a team, it is well created, BUT when he leaves the championship the team is not deleted because the find() method is not returning it, and the user is still referenced in the team even if not in this championship anymore. I'm disabling english to avoid more damages until I can fix this properly. How can I fix this? And if you have informations about this behavior, please explain or give documentation links, I'm a bit lost actually.
-
Check that the root directory configured in your web server is the same than previous. The path before that has no importance. And obviously, don't use absolute paths in your code, but that shouldn't be the case. Also maybe check if your less compiler has an option to delete its cache, or a cache directory that is set to an absolute path maybe?...
-
Any way to access $languages API var inside Page Class?
da² replied to TomPich's topic in General Support
languages() global function is another way to get the instance, but wire()->languages property should work too. -
Any way to access $languages API var inside Page Class?
da² replied to TomPich's topic in General Support
Hello, You can use $this->languages, wire()->languages or wire('languages'). I prefer to use wire()->languages so PhpStorm knows what I'm using. -
If trying to migrate an existing site from one server to another, the easiest is to copy files and replicate the database. No need to use the PW installer. Then, if wanted, you can update PW to the last version using the official module ProcessWireUpgrade.
-
Unexpected behavior with PHP selector with empty string
da² replied to suntrop's topic in API & Templates
Both codes are NOT giving the same selector, you could check by printing it. First case gives: "item_number= " (with a space) Second one gives: "item_number=' '" (space inside quotes) To find empty values, you can just use "item_number=''" (no space inside quotes), or "item_number=" (nothing after equal). But I don't know why the first one is returning a page with item_number=50032. If you're sure everything is right on your side, maybe report a bug on Github. -
Hello, Are you using Apache? Is it configured to read .htaccess files? Is mod_rewrite enabled? https://gcore.com/learning/how-enable-apache-mod-rewrite/
-
Hi, https://caniuse.com/?search=mp4
- 1 reply
-
- 1
-
-
I won't help for reading a function name. 😆 I don't know the module, check the documentation.
-
Page Field autosave strategies and dependencies
da² replied to Kiwi Chris's topic in General Support
Question is: will the Javascript be aware of the changes on the field? I bet no, and that it will need to be reloaded. I confirm that, I had to remove these conditions on a page because it was totally bugged (3 or 4 fields with dependencies), reported the issue but nothing has been done. 😐 -
Hi, My first though is about .htaccess. Is it the original one? Does the web server process it correctly and does the server have more rules (redirections...) that could interfere with the PW .htaccess rules? Could it be related with the 404 page configuration in config? $config->http404PageID = 27; Also check that no hook is doing that redirection, like a hook that would say: "redirect normal and guest user to home page if they try to access admin"? ^^
-
Use hook to change order of child pages in site tree
da² replied to DrQuincy's topic in API & Templates
Yes, you can do it by changing the parent page template sorting option. The child template doesn't change, only the sort option on parent page template. /blog/ sorts children: most recent first /events/ sorts children: date order ascending -
Use hook to change order of child pages in site tree
da² replied to DrQuincy's topic in API & Templates
-
If you have a search page that allows to search text in a lot of pages containing big texts, you probably need it. Do a performance benchmark with and without. Yes but without the mistake you did on the method name. 😁
-
Best way to deal with multilingual images that are optional
da² replied to joe_g's topic in Multi-Language Support
I didn't play with multilanguage image fields, but if it's the same behavior than with other multilanguage fields (probably) you have nothing to do: if a multilanguage field defines a value for the current user language, then this value is used, otherwise the default language value is used. EDIT : hmm, looks like there's no multilanguage image field, so language alternate fields looks like the only solution, and then a hook like @ngrmm proposed sounds good. -
Hi, In my experience we did that with project management softwares like Redmine, or Jira for a paid solution. You create user stories, tasks, estimate time and so on...