Problem to execute my first job

Permalink
Hello all,

when I execute my job, it remains in a loop, and I dont have any error message but the job is not running.

I want him to create me pages from xml file.

My file : import_portfolio.php
<?php
namespace Application\Job;
use \Job as AbstractJob;
class ImportPortfolio extends AbstractJob {
   /** Returns the job name.
   * @return string
   */
   public function getJobName() {
      return t('Import data');
   }
   /** Returns the job description.
   * @return string
   */
   public function getJobDescription() {
      return t('Load my portfolio - category design');

 
pixelhero replied on at Permalink Reply
pixelhero
You are not creating a new page between these lines, $newPage does not exist. You'll probably find your job is throwing PHP errors or a blank response because of that and the job never finishes:

$pt = CollectionType::getByHandle("portfolio");            
$newPage->setAttribute('lien_url', $prtf->COL[3]->DATA);


change it to this, or similar, see: http://documentation.concrete5.org/developers/working-with-pages/wo...

$pt = CollectionType::getByHandle("portfolio");   
$parentPage = Page::getByPath('/');
$newPage = $parentPage->add($pt, $data);
$newPage->setAttribute('lien_url', $prtf->COL[3]->DATA);
mhawke replied on at Permalink Reply
mhawke
This forum is actually meant for folks looking to hire a developer to complete a 'job' for them for pay. It isn't really about the 'jobs' functionality within concrete5. If you just want advice than I would re-post your question on the regular support forums.
belhmidi replied on at Permalink Reply
I'm so sorry, I think this is category Jobs in concrete5.

with a pleasure, you can change my request to right place :-)
mhawke replied on at Permalink Reply
mhawke
I'm not an admin here so I can't move it. You should just copy 'n paste your original question into a new post on the regular forums.