Jump to content

Gazley

Members
  • Posts

    526
  • Joined

  • Last visited

Everything posted by Gazley

  1. Hi, Repurposed this question as no takers in the module forum. I created a simple autoload module. It is definitely loaded at page instantiation time - I step through its init() call in the debugger. However, when it is referenced later, wire('ModuleName') returns null. I can however reference it using $modules->get('ModuleName') Any ideas why this might be the case? Thanks.
  2. HI there, I've just created a new module with autoload set true, in a new install of ProcessWire in a new version of Mamp using PHP 5.5.10. The problem I'm having is that when I reference wire('ModuleName'), I'm getting nothing back (it's null). If I say $modules->get('ModuleName'), I get a reference to the module. I get the same problem using the 'Helloworld' module supplied with ProcessWire. Any ideas what the issue might be? Is anyone using PHP 5.5.10 - maybe this is a problem? Thanks!
  3. Hi, I've a custom page with a field called 'password' of type 'Password'. I've made it a 'required' field. The first time the page is saved, the password is required as you would expect. The problem is, any subsequent changes made to the page cannot be saved because the password 'required' validation is being applied by the page even though there is an underlying password already set and in the DB. I only want the required validation to apply if there is no password set, not when the password field appears "empty". Any suggestions? Thanks!
  4. No problem - this sorted it out nicely! http://processwire.com/talk/topic/4416-delete-user-when-page-is-deleted/?p=43345 Thanks Soma
  5. Hi, I have a "normal" page called "Customer". The data in this page is sufficient to create a "User" page. This User page uses the same name as the Customer page and a custom role is added. The User record is created perfectly and the User can log in without problem. When I delete the Customer, I also want to delete the User record. I have hooked the "trash" method in Pages. The method below gets called. Control gets to the line: wire('pages')->delete($user); and the User instance is the correct one. Despite this, when I go back to the Users list, the User record is still there. Any ideas why this record might is not being deleted? Thanks. private function customer_before_delete() { $page = $this->hooked_page; $users = wire('pages')->find("template=user, name=$page->name"); $user_cnt = count($users); if ($user_cnt === 1) { $user = $users->eq(0); wire('pages')->delete($user); } }
  6. Thank you for a great suggestion!
  7. A great answer from Soma. However, here's a further question around this topic ... I quite often take a backup of the server DB and install it locally when I want to work on the site. Generally, the data is more up to date on the server than on my local copy. If I install the backup from the server, I have no SSL certificate locally and I cannot get into the Admin section. Any suggestions as to how to get around this? Thanks.
  8. These are the kinds of answers you want when brevity is key! Thanks apeisa
  9. Hi there, Just wondered whether anyone could explain something for me? I am building a page that renders a gallery of images specific to a user who has previously logged in. If the user interacts with an image on the page eg., Likes it, Hides it etc., I want to make an Ajax callback to update the image status on the server. Here's the real question(s): 1) Using jQuery Ajax, will the targeted page/URL still be able to "know" the currently logged in user? 2) I want to send data about the image and what has been done to it by the user. Is Json a good candidate for this? Is there a "best" way to build Json "client side". Many thanks.
  10. Thanks Joss - I've contact him and he seems like a good guy! It's amazing what you find out in the ProcessWire forums Thanks again.
  11. I've got an original Feb'61. I bought it 30yrs ago on the way to a gig. It's the third of three pre-cbs Strats that I've owned. I don't play it any more - last time I played professionally was circa 1986. I'd like to get it set up and maybe I'd play it again. The wiring and pots were in need of some attention the last time I played it. Years ago, I used Ted Lee and then, Gordon Whittam of "Gordon Smith" guitar fame. I haven't a clue who I could trust with it now from the POV of understanding these old guitars. If you know anyone, maybe you could let me know. Cheers.
  12. Thanks Joss - that helped. Is that a Strat in the background of your picture?
  13. Let's see. $pages->get('/microdata/software-application/') The above returns the correct page but you can only "see" the Title field. The other fields in the page are "missing".
  14. Hi, I have a Page field that has a parent page called "micro_data" and child pages called "micro_datum". The idea is that you can select a microdata type eg: "Software Application" This Page field is utilised inside a Repeater in my basic-page template. micro_datum contains the Title field and several others, including Body. When I look at the micro_datum field via the Repeater page instance or, directly query the page like so: $pages->get('/microdata/software-application/') where software-application is the name of the micro_datum page, I cannot see any field in the Page result, except "Title". It almost seems that using micro_datum in the micro_data Page field constrains the visibility of all fields except "Title". Any ideas what might be happening here? Thanks --Gary
  15. Hey apeisa - thanks for helping me. It turned out to be in the DB but I grepped a backup file to find it! Phew - mystery over
  16. Hi Apeisa - yes, there are: ACE, FormBuilder, ModulesManager, TextFormatter, TextFormatterTextile, TextFormatterVideoEmbed. --Gary
  17. Hi there, When I execute a crawl on a localhost (and the live server) site using ScreamingFrog, I get a 404 and the following URL showing up: http://localhost:8888/gx/products/mobiles/<?=$pages->get('/smart-devices/')->url?> I have searched through the site but cannot find anything containing this. I have no idea where this is coming from and wonder if anyone can tell me how/why this is showing up? Thanks, --Gary
  18. Hi there, I just amended the admin URL through the UI - nice! However, I've looked and searched but can't find an answer sooooo, here is the question:- Can you change the admin password in the UI? I have a better admin URL now but the same old rubbish password! Cheers! --Gary
  19. Problem resolved. I renamed the "site" folder and re-installed from GitHub. I ran that against my DB and it all worked. Seems that "installing" PW is not really required when you have an existing site that you can "copy". If my assumption isn't correct, I'd like to be corrected so I can understand this situation better Thanks for the help! --Gary
  20. Hi diogo, Boy I'm confused now. I deleted the installed file and copied a new version of config.php. This then allowed me to go through the install procedure. Happy days, it went through fine. I tried to load my index page but immediately, PW logged an error: Error: Exception: Unable to install module 'TextformatterVideoEmbed': Table 'textformatter_video_embed' already exists I don't know why PW is trying to install this module because it is already installed? When I load the site in admin mode, I see a new "standard" page tree configuration of PW and not the page tree configuration that I restored into the DB. However, if I check the DB, I see my restored DB on the live server. In config.php on the live server, it is indeed pointing to the correct DB so I don't understand why PW admin mode isn't loading the page structure from the DB? Just to give some background (your earlier comment suggested I wasn't clear enough in describing what I had done): The site has been developed on my MAMP localhost. I have the site folder on GitHub I cloned the site folder from GitHub into the document root on my live server I restored the associated DB from my local MySQL onto my live server's MySQL Any ideas? Thanks --Gary
  21. Hi diogo Thanks for replying The $config->dbName directive is in the file. However, this will be from my localhost that I pushed to GitHub and then cloned into my Root folder on the live server. So, the DB isn't installed in MySQL even though it is specified in the config file. Any suggestions? Thanks --Gary
  22. Hi there, I'm just in the middle of installing a PW site on a live server. I pointed the browser at the domain before I had called the install.php script. An error message occurred that I failed to record However, I pointed the browser at the site specifying the install.php script but I get the following message in the browser: "This installer has already run. Please delete it." It most definitely hasn't presented the installation options or anything like that. My question is whether and how I can re-run the install.php script? I have since renamed htaccess.txt to .htaccess If anyone can point me in the right direction, I'd be very grateful indeed! Cheers --Gary
×
×
  • Create New...