[Frage] dmmjobcontrol - keine Suche nach Kategorie oder Region/Ort möglich TYPO3-Version: 6.2.7

  • 0 x
    103 Beiträge
    0 Hilfreiche Beiträge
    10. 01. 2015, 03:23

    Hi!

    Verwende Typo3 6.2.9 und die Extension dmmjobcontrol in der aktuellen Version. Leider kann ich nicht nach Kategorie oder Region/Ort suchen. Die Suche nach Stichwort liefert mir Ergebnisse. Bei Suche nach Kategorie oder Region/Ort (beides DropDown-Felder) liefert die Suche keine Ergebnisse.

    Kann es sein, dass der Fehler in folgender Funktion liegt?:

    1. function getFormSelect($field) {
    2. global $TCA;
    3.  
    4. $session = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->prefixId);
    5.  
    6. if (isset($this->conf['multipleselect.'][$field]) && $this->conf['multipleselect.'][$field] != 1) {
    7. $multiple = ' multiple="multiple" size="'.$this->conf['multipleselect.'][$field].'"';
    8. } else {
    9. $multiple = '';
    10. }
    11.  
    12. $return = '<select name="tx_dmmjobcontrol_pi1[search]['.$field.'][]" class="dmmjobcontrol_select dmmjobcontrol_'.$field.'"'.$multiple.'>';
    13. if ($multiple == '') {
    14. $return .= '<option value="-1">'.$this->pi_getLL('form_select_text').'</option>';
    15. }
    16.  
    17. if (isset($TCA['tx_dmmjobcontrol_job']['columns'][$field]['config']['MM'])) {
    18. // The values for the select come from another table
    19. $whereAdd = 'pid IN ('.implode(',', $this->sysfolders).')';
    20. $whereAddLang = ' AND sys_language_uid='.$GLOBALS['TSFE']->sys_language_content;
    21. $sort = $this->conf['sort.'][$field] ? $this->conf['sort.'][$field] : ($this->conf['property_sort'] ? $this->conf['property_sort'] : 'name ASC');
    22.  
    23. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, name', $TCA['tx_dmmjobcontrol_job']['columns'][$field]['config']['foreign_table'], $whereAdd.$whereAddLang, '', $sort);
    24. while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
    25. $selected = '';
    26. if (isset($session['search'][$field]) && in_array($row['uid'], $session['search'][$field])) {
    27. $selected = ' selected="selected"';
    28. }
    29.  
    30. $return .= '<option value="'.$row['uid'].'"'.$selected.'>'.$row['name'].'</option>';
    31. }
    32. } elseif (is_array($TCA['tx_dmmjobcontrol_job']['columns'][$field]['config']['items'])) {
    33. // The values are in $TCA
    34. foreach ($TCA['tx_dmmjobcontrol_job']['columns'][$field]['config']['items'] AS $row) {
    35. $selected = '';
    36. if (isset($session['search'][$field]) && in_array($row[1], $session['search'][$field])) {
    37. $selected = ' selected="selected"';
    38. }
    39.  
    40. $return .= '<option value="'.$row[1].'"'.$selected.'>'.$GLOBALS['TSFE']->sL($row[0]).'</option>';
    41. }
    42. }
    43.  
    44. $return .= '</select>';
    45.  
    46. if ($this->conf['show_icon'] && $selected == ' selected="selected"') {
    47. $return .= '<img class="dmmjobcontrol_selected_icon" src="typo3conf/ext/'.$this->extKey.'/icon_tx_dmmjobcontrol_arrow.gif" alt="" title="selected">';
    48. }
    49.  
    50. return $return;
    51. }

    Oder an der übergeordneten Funktion?:
    1. function getFormData() {
    2. $markerArray['###FORM_ATTRIBUTES###'] = ' action="'.$this->cachedLinkToPage($this->conf['pid.']['list']?$this->conf['pid.']['list']:$GLOBALS['TSFE']->id).'" method="post" ';
    3. $markerArray['###SECTOR_SELECT###'] = $this->getFormSelect('sector');
    4. $markerArray['###REGION_SELECT###'] = $this->getFormSelect('region');
    5. $markerArray['###CATEGORY_SELECT###'] = $this->getFormSelect('category');
    6. $markerArray['###DISCIPLINE_SELECT###'] = $this->getFormSelect('discipline');
    7. $markerArray['###EDUCATION_SELECT###'] = $this->getFormSelect('education');
    8. $markerArray['###CONTRACT_TYPE_SELECT###'] = $this->getFormSelect('contract_type');
    9. $markerArray['###JOB_TYPE_SELECT###'] = $this->getFormSelect('job_type');
    10. $markerArray['###SEARCH_NAME###'] = 'tx_dmmjobcontrol_pi1[search_submit]';
    11. $markerArray['###RESET_NAME###'] = 'tx_dmmjobcontrol_pi1[reset_submit]';
    12. $markerArray['###KEYWORD_NAME###'] = 'tx_dmmjobcontrol_pi1[search][keyword]';
    13.  
    14. $session = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->prefixId);
    15. $markerArray['###KEYWORD_VALUE###'] = htmlspecialchars($session['search']['keyword'], ENT_QUOTES);
    16.  
    17. // Extend the markerArray with user function?
    18. if (isset($this->conf['searchArrayFunction']) && $this->conf['searchArrayFunction']) {
    19. $funcConf = $this->conf['searchArrayFunction.'];
    20. $funcConf['parent'] = & $this;
    21. $markerArray = $this->cObj->callUserFunction($this->conf['searchArrayFunction'], $funcConf, $markerArray);
    22. }
    23.  
    24. return $markerArray;
    25. }

    ###KEYWORD_VALUE### funktioniert. ###CATEGORY_SELECT### z.B. nicht.
    Danke für eure Hilfe!


  • 1
  • 0 x
    103 Beiträge
    0 Hilfreiche Beiträge
    11. 01. 2015, 00:07

    Ich vermute das liegt nicht an obiger Funktion. Es liegt glaub ich eher an folgenden Zeilen:

    1. // Get categories
    2. $resMM = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('tx_dmmjobcontrol_category.*', '', 'tx_dmmjobcontrol_job_category_mm', 'tx_dmmjobcontrol_category', 'AND tx_dmmjobcontrol_job_category_mm.uid_local='.$row['uid']);
    3. $array = array();
    4. while($rowMM = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resMM)) {
    5. $array[] = $rowMM['name'];
    6. }

    Hat TYPO3 6.2.9 irgendein Problem mit "exec_SELECT_mm_query"??

  • 0 x
    103 Beiträge
    0 Hilfreiche Beiträge
    11. 01. 2015, 02:59

    Ich komme der Sache schon näher. Im TYPO3 Backend Protokoll habe ich gesehen dass die Datei dmmjobcontrol/pi1/class.tx_dmmjobcontrol_pi1.php in Zeile 255 den Fehler verursacht.
    Die besagte Zeile ist folgende:

    1. $whereAdd[] = $table.'.uid_local=tx_dmmjobcontrol_job.uid AND ('.$table.'.uid_foreign='.implode(' OR '.$table.'.uid_foreign=', intval($value)).')';

    Der größere Abschnitt ist
    1. // If there is a search-session, then extend the query arrays to make the search (but not for rss feeds of course)
    2. if (!$this->rssMode && !$this->conf['ignore_search']) {
    3. $session = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->prefixId);
    4. if (isset($session['search']) && $search = $session['search']) {
    5.  
    6. foreach ($search AS $field => $value) {
    7. if (is_array($value) && count($value) == 1 && current($value) == -1) {
    8. continue;
    9. }
    10.  
    11. if (isset($TCA['tx_dmmjobcontrol_job']['columns'][$field]['config']['MM'])) {
    12. $table = $TCA['tx_dmmjobcontrol_job']['columns'][$field]['config']['MM'];
    13. $tableAdd[] = $table;
    14. $whereAdd[] = $table.'.uid_local=tx_dmmjobcontrol_job.uid AND ('.$table.'.uid_foreign='.implode(' OR '.$table.'.uid_foreign=', intval($value)).')';
    15. } elseif ($field == 'keyword') {
    16. $keywords = str_replace(array(','), ' ', $value);
    17. $keywords = explode(' ', $keywords);
    18.  
    19. foreach ($keywords AS $keyword) {
    20. $keyword = addslashes($keyword);
    21.  
    22. $whereAdd[] = '(tx_dmmjobcontrol_job.job_title LIKE "%'.$keyword.'%" OR '.
    23. 'tx_dmmjobcontrol_job.job_description LIKE "%'.$keyword.'%" OR '.
    24. 'tx_dmmjobcontrol_job.location LIKE "%'.$keyword.'%" OR '.
    25. 'tx_dmmjobcontrol_job.reference LIKE "%'.$keyword.'%" OR '.
    26. 'tx_dmmjobcontrol_job.job_requirements LIKE "%'.$keyword.'%")';
    27. }
    28. } elseif (isset($TCA['tx_dmmjobcontrol_job']['columns'][$field])) {
    29. // !!!
    30. // listQuery doesn't do IN statement
    31. // !!!
    32. $value = current($value);
    33. $selectAdd[] = 'tx_dmmjobcontrol_job.'.$field.' AS '.$field;
    34. $whereAdd[] = $GLOBALS['TYPO3_DB']->listQuery($field, $value, 'tx_dmmjobcontrol_job');
    35. } else {
    36. continue;
    37. }
    38. }
    39. }
    40. }

    Der Fehler lautet: Core: Error handler (FE): PHP Warning: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in /typo3conf/ext/dmmjobcontrol/pi1/class.tx_dmmjobcontrol_pi1.php line 255

  • 1