joer80 Posted June 4, 2014 Share Posted June 4, 2014 I saw a post on the forum that shows how to do a custom admin process wire module but it puts it in the "/wire/modules/" directory which adds it to the core tab. If I want to do a new admin process module, can I put it in the "/site/modules/" folder instead, and still select it as a process on an admin page? Thanks! Link to comment Share on other sites More sharing options...
kongondo Posted June 4, 2014 Share Posted June 4, 2014 Yes. Everything custom should go to /site/xxxx. This way, on updating ProcessWire, nothing gets overwritten (i.e. /wire/ is overwritten on updating PW). Just curious, what custom module is that that was placed in /wire/modules? Link to comment Share on other sites More sharing options...
joer80 Posted June 4, 2014 Author Share Posted June 4, 2014 I was following the directions listed here. Got to it from a Google search result https://processwire.com/talk/topic/276-creating-new-admin-page/?p=1856 Link to comment Share on other sites More sharing options...
kongondo Posted June 4, 2014 Share Posted June 4, 2014 Thanks for posting. I see nowhere on that whole thread any instruction to put anything in "/wire/modules/". Ryan especially wouldn't say that ....What the post says, in short, is that if you want a menu link to appear somewhere in the main Admin menu, just create a new child page of Admin. It will automatically be listed up there with 'Setup', 'Pages', etc. Of course, that link leads somewhere...e.g. a ProcessModule. In that case, the page will normally be created within your ProcessModule on install and not you doing it manually... 2 Link to comment Share on other sites More sharing options...
joer80 Posted June 4, 2014 Author Share Posted June 4, 2014 This post deleted because I was confused. (Happens all the time.) Link to comment Share on other sites More sharing options...
joer80 Posted June 4, 2014 Author Share Posted June 4, 2014 The forum post mentioned "/site/modules/", and that is where I uploaded it, and it still found it in the core tab! That is why I got confused! So basically what I am seeing is, I upload a module to the site folder, and it adds it to the wire/core tab instead of the site tab when you are on the /admin/module/ page! Link to comment Share on other sites More sharing options...
joer80 Posted June 4, 2014 Author Share Posted June 4, 2014 In case it is a bug, I am running ProcessWire 2.4.0 It looks like it picks it up in the wire tab, but if you click install it fails because the file is not there. (It is in the site folder.) This is the error if you click install: Error: Class 'readCSV' not found (line 565 of /home/(removed)/public_html/goac/wire/core/Modules.php) This is what is in the file: /site/modules/readCSV.module <? class ProcessReadCSV extends Process { public static function getModuleInfo() { return array( 'title' => 'Read CSV', 'summary' => 'This Module Reads the csv files under the csv page.', 'version' => 001, ); } public function execute() { return "<p><a href='./hi'>hi</a> or <a href='./bye'>bye</a></p>"; } public function executeHi() { $this->message("Well hello"); return "<p>You clicked hi!</p>"; } public function executeBye() { $this->setFuel('processHeadline', 'Goodbye?'); $this->error('Not so fast!'); return "<p>You clicked bye!</p>"; } } ?> Link to comment Share on other sites More sharing options...
joer80 Posted June 4, 2014 Author Share Posted June 4, 2014 I wonder if it could be because I named it "class ProcessReadCSV" and the Process part is making the cms think it is a core module? Update: I just tested it, and renameing the class file fixes it! So changing: class ProcessReadCSV extends Process { to class ReadCSV extends Process { Does in fact move it from the wire tab to the site tab. (Even if the file is physically located in the site tab. So doing the example posted in that forum will cause an error when you install the module! Link to comment Share on other sites More sharing options...
apeisa Posted June 4, 2014 Share Posted June 4, 2014 No, naming modules ProcessXxx doesn't move them to core tab. You probably saw it in core tab if you had it in wire folder first - module information gets cached. Also filename and classname should match. In your case ProcessReadCsv.module and class ProcessReadCsv 1 Link to comment Share on other sites More sharing options...
joer80 Posted June 4, 2014 Author Share Posted June 4, 2014 That is what I am saying. I never uploaded to the wire tab. And I can shoot it both places by updating the file in the site folder. When I change the class name, it moves from tab to tab. I am pretty sure you are correct and the bug is because I named the file readCSV.module and the class ProcessReadCSV and that caused it to go to the core tab? As soon as they are both readCSV it moves to the site tab! Link to comment Share on other sites More sharing options...
joer80 Posted June 4, 2014 Author Share Posted June 4, 2014 In the example in the forum, he had the file named ProcessHello.module and the class name ProcessHello, so it is correct! My issue was because my class name did not match my filename as apeisa suggested. Now that both match on mine, it is working now! Thanks for your helps guys! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now