Jump to content

neildaemond

Members
  • Posts

    134
  • Joined

  • Last visited

Everything posted by neildaemond

  1. I just had an interesting issue. I suspect that the web host did something with apache which caused a short timeframe in which the "index.php" file was served instead of the PHP generated output. Firefox found the correct response when it was available(or didn't ever receive the index.php file) , but Chrome and Edge seemed to cache the index.php file. When I tried the link via Chrome thereafter, the index.php would just download with the filename "download". After clearing the cache and cookies, it was fine. but it took some time, worrying, and convo with support before I concluded that I had received an index.php and cached it. Now, I'm wondering if there is anything I can do to fix the issue for anyone else affected by the issue other than telling them "clear your cache and cookies". Anyone ever have similar experiences? Should we have a statement like: Header("Cache-Control: max-age=3000, must-revalidate"); in our default index.php file? Cheers,
  2. Some unusual stuff happening on Freenode since the change in ownership (https://lwn.net/Articles/857252/). I got banned from freenode as a spammer just because I mentioned the word 'libera' in a room. Libera (https://libera.chat/) seems to be the place where the Freenode staff channels are are moving to & I've opened up a channel there. Please join!
  3. I use the terminal client weechat. After finding a nice little site https://tilde.club , use their ssh login and have weechat open with a screen all the time. I've just connected weechat-android to it which is a nice irc client for the mobile which ssh relays into the originally running weechat client. However, it only keeps history while logged on.. and what that tilde.club server restarts, I have to reconnect 😞 . I'm looking for a way to keep history during those restarts.
  4. I'm glad this channel is still up. I've recently joined on IRC and am keen to chat with anyone else in the PW community who would like to hang out there as well 🙂
  5. I recently joined #processwire on freenode and plan to hangout there. I hope others who want to try IRC or are already use it will join as well :) I found that everyone has their preferred communication channels and there isn't really a need to make everyone conform to one official one. Of course, using the less popular option means that you're not entitled to receive all the newest updates unless someone relays it. Processwire's newsletter already works quite well for me in that regard.
  6. It's been so long I don't remember the details. But, I found that js file here now: http://archived.neilpahl.com/PWformToWizard-validate.js
  7. I'm I was (solution below) experiencing the same as below on PW 2.5.2, after installing via softaculus(which uses minimal site profile) on a cpanel based hosting: except, When I try to reach www.seconddomain.com it displays as if I'm using www.maindomain.com Also, http://www.seconddomain.com/www.seconddomain.com/ redirects to http://www.seconddomain.com/ SOLVED: needed to add www.seconddomain.com to $config->httpHosts in /site/config.php
  8. I've sorted it. I just had to re-install the PageLinkAbstractor plugin and all those {~root_url} and {~page_5813_url} started getting converted.
  9. I'm seeing this in a site which I'm migrating... how should I go about fixing it? I still have access to the working legacy site.
  10. I still see an extra "</script>" tag at the bottom right before the </body> ... I saw it by viewing the source in the browser and it's there on all pages. It's probably some extra markup in your foot.inc file... if you kept using those files.
  11. It's been a while since I first made this site, and there has been some updates The old site design which I first posted about was kept on corporate.ccw-global.com and I've done bootstrap based redesigns (UI focused) for www.ccw-global.com and hk.ccw-global.com Processwire has allowed or content writer to plant focused article/blog feeds and maintatin a SEO friendly URL structure. Article feeds are like those found on: http://hk.ccw-global.com/specialist-insurance/specialist-articles/ http://hk.ccw-global.com/health-insurance/resources/articles/ We've been able to upload TONS of pages, and keep them well organized with PW's nice backend and were able to use custom fields extensively to allow content writers to insert proper meta-data. Very happy with how it's working for us. Almost forgot, we added muli-language capability on http://www.ccw-global.com/es/
  12. sorry to highjack the thread but WOW, multi-language urls have come a long ways since I've last implemented the hacked urlsegment detection version we used to have... do links in the content switch to the appropriate language url automatically? Alice, I think that diogo was saying how instead of creating two branches of pages, you could use multi-language fields and urls in your pages to give them multi-language capability. This will result in much less overhead of creating duplicate pages... but, slightly less flexible if you wish to have different content based on the language (which doesn't seem to be te case). If all your pages are going to be translated, I recomend using multi-language fields and urls.
  13. I'm seeing an issue with importing Chinese. I have a column which is importing Chinese text. However, only the rows which contained an English letter in it will import. The imported field will omit the initial Chinese, then start with the English segment, then the rest of the Chinese will follow as expected.
  14. hey guys, I tried putting the following code into /site/modules/SetPublishDate.module /** * * "Set Publish Date" module * */ class SetPublishDate extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Set Publish Date', 'version' => 001, 'summary' => 'your summary', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // add a hook after the $pages->save $this->pages->addHookAfter('save', $this, 'afterSave'); } public function afterSave($event) { // get page object saved $page = $event->argumentsByName('page'); // only on pages that have a publish_date field if(!$page->template->hasField('publish_date')) return; if($page->is(Page::statusUnpublished)) { // if unpublished, empty the field if not empty already if(!$page->publish_date) return; $page->publish_date = ''; $page->save('publish_date'); } else if(!$page->publish_date) { // if page (published) and field not populated, add current timestamp $page->publish_date = time(); $page->save('publish_date'); } } } However, in the module section it will detect the module but then shows as version 0.0.0 and summary 'inactive' after pressing 'install', if get these errors: /** * * "Set Publish Date" module * */ class SetPublishDate extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Set Publish Date', 'version' => 001, 'summary' => 'your summary', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // add a hook after the $pages->save $this->pages->addHookAfter('save', $this, 'afterSave'); } public function afterSave($event) { // get page object saved $page = $event->argumentsByName('page'); // only on pages that have a publish_date field if(!$page->template->hasField('publish_date')) return; if($page->is(Page::statusUnpublished)) { // if unpublished, empty the field if not empty already if(!$page->publish_date) return; $page->publish_date = ''; $page->save('publish_date'); } else if(!$page->publish_date) { // if page (published) and field not populated, add current timestamp $page->publish_date = time(); $page->save('publish_date'); } } } Error Class 'SetPublishDate' not found (line 437 of /var/www/xxxx/wire/core/Modules.php) This error message was shown because you are logged in as a Superuser. Error has been logged. Any ideas? I'm using PW2.2.9 EDIT (SOLVED) -> I left out the "<?php" at the beginning of the file.
  15. did this ever end up being an official module? did anyone improve on this method?
  16. Thanks for the responses and good Idea Ryan, I'll try that if I have those kind of migration issues. I ended up upgrading my staging and dev server settings so that I don't need to work on sub-directories. It was a change I had been wanting to make with virtual hosts on my staging server, the urls now look like "cilentname.mydomain.com" instead of "mydomain.com/clientname/" For development within my own network, I updated my dev machine's /etc/resolve.conf so that the url "clientname" will resolve to the dev server ip. Again, setting up virtual hosts on my dev machine. I feel much more confident adding links into content with the new setup and don't feel obligated to rely on pageLinkAbstractor too much
  17. good question, Ryan and it lead me to the solution. Although I had "allow page numbers" enabled on the template containing the paginationMarkup (the blog/news feed), I didn't have it enabled on the 'language-gateway' template. So, settings "allow page numbers" on the 'language-gateway' template solved the issue Perhaps we can mention this little caveat in the documentation
  18. i've used "Example 3: Display a different language based on URL pre-segment" from the guide to make a site multi-language capable.. my language gateway looks like: <?php $user->language = $languages->get($page->name); $path = '/'; foreach($input->urlSegments as $segment) { $path .= $segment . '/'; } $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); //replace local navigation links $out = $mypage->render(); $regex = '{(<a [^>]*href=["\']' . $config->urls->root .')(["\']'; $topnav = $page->parent->children(); foreach($topnav as $p) $regex .= "|" . $p->name; $regex .= ")}"; $out = preg_replace($regex, '$1' . $page->name . '/$2', $out); echo $out; the regex works quite well for everything else, but but kind of skews up on the 'blog/news' page which uses pagination. besides the fact that the pagination links end up as 'site.com/blog/blog/page2' instead of 'site.com/blog/page2', even when manually entering 'site.com/blog/page2', 4040 error is thrown. I'm guessing that things go bad here: $mypage = $pages->get($path); if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception(); since "path/to/page/page2" will not not return a page. Also, removing the "throw new 404" line, I end up with a blank page. Any suggestions? Thanks,
  19. It seems that there may be an issue with using Page Link Abstracter module with TextAreaLanguage. Whether I'm using a rich-text editor (i tried both TinyMCE and CKEditor) or plaintext field which contains a link or image, the above error msg in OP is shown and the page doesn't save. This only applied to the 'default' language, as I was able to save links and images in the language specific sections. After disabling the Page Link Abstracter for the field in question, there were no more errors. Unfortunately, I’m building my page under a sub-directory so being able to use page link abstracter will be nice.
  20. uhm.. okay, I dont' know what I did (I really didn't do much except for more diagnostic testing), but it just started working. Edit: Nevermind, it doesn't work when adding links/images to the 'default' box/field... works under the alternate language box/field
  21. If I try to add a link or image into any part of a the 'default' box in a textareaLanguage field I get the following error when trying to save the page: Error: Call to a member function getLanguageValue() on a non-object (line 363 of /var/www/ctw/wire/modules/LanguageSupport/LanguageSupportFields.module) I've just recently changed a few textarea fields into textareaLanguage fields, then changed their options to use TinyMCE. I also have Page Link Abstractor enabled under the "Convert root URLs and page URLs: Prevents broken links when linked pages are moved" mode. I think I've used this same configuration before without a problem.... Does anyone know how to rectify this? Thanks,
  22. I've once had weird 'unexplainable' login issues caused by those seo tools that some web hosts provide in their control panel. It was a while ago, but I think they installed some folders(maybe they were invisible ones) to the web root. After deleting them, and doing away with those tools the login problem cleared up. Edit (added more): It screwed me up because after signing up for those services, the functionality 'kicked in' at some random later time, making it hard to make the connection.
  23. Thanks, I'll try that as a workaround for now. It feels like it's going to be a pain to debug for what its worth, but I'll post if I ever pinpoint the exact cause or find a solution.
  24. Hi, Sometimes when I try to change a page's template, I get this error thrown up by apache upon clicking 'save' : Not Found The requested URL /subdir_my_project_is_in/pw_admin/page/edit/saveTemplate was not found on this server. Additionally, a 401 Authorization Required error was encountered while trying to use an ErrorDocument to handle the request. Usually I just delete the page and add a new one with the same name, but this time I'm trying to change the '404 Page Not Found' page's template and am hesitant bc I'm not 100% sure how it's being reffered to. Could this be a problem with how my PHP is configured? or related to the fact that my website is at subdirectory (/var/www/project/) instead of the web root (/var/www/)? Thanks
×
×
  • Create New...