[레거시코드] 라이믹스XE 마켓플레이스(marketplace) 부활 프로젝트.
2023.07.06 08:37
0
https://eond.com/457234

https://github.com/chujihyun/marketplace


https://github.com/hellojo011/marketplace_XE


수정내용

# 버전정보
- 원본제작자 : 업글
- 배포글 : https://xe1.xpressengine.com/forum/22923470
1) marketplace.1.3.0-eond
- 사진1개만 올렸을 경우 대표사진값 필수입니다라는 오류는 있음.
2) marketplace.1.3.0-bluewings
- 사진1개만 올렸을 경우 대표사진값은 필수입니다라고 뜸
- 판매완료 클릭시 오류는 동일함
3) marketplace.1.3.1
현재 서버에 이렇게 있는데
아마 1)은 이전버전이고, 2)와 3)이 최신인듯하다.
1)이 글등록 정상동작함.
4) marketplace.1.3.0 
이게 그냥 정상인듯-_-a;;; 이온디 버전이랑 동일함. 블루윙즈는 1개만 등록 안됨.
- marketplace.controller.php 파일이 조금 다른 듯
5) marketplace.1.4 버전으로 새로 시작함(22.10.09)
---
### 1. 이슈1 - 상품중단 클릭시 오류
```
modules/marketplace/marketplace.admin.view.php:40 
```

### 2. 이슈2 - 연락처 필드 - 셀렉트
셀렉트를 기본입력으로 변경하기.
라이믹스 기준 기존 사용자 휴대폰 정보 필드로 교체하기(x)
<option value="phone_number">phone_number</option> 기본값 추가하기

### 3. 이슈3 - 내용추가 안됨
### 4. 이슈4 - 상품정보수정 안됨
### 5. [해결] 이슈 5 - 판매완료 후 오류메세지
```
Error #0 "Call to undefined function eregi_replace()" in modules/marketplace/marketplace.item.php on line 1407 
```
참조 : https://m.blog.naver.com/psj452771/221081835493
php6부터 eregi_replace 함수는 사라졌음.preg_replace 로 교체해야함
```
/*

preg_match

int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )


패턴에 주어진 정규 표현식에 일치하는 제목 검색합니다.


Return Values

preg_match ()는 시간 패턴 일치의 수를 반환합니다. preg_match ()는 첫 번째 일치 후 검색을 중지하기 때문에 그것도 0 회 (없음 일치) 또는 1 시간이됩니다. 그것이 주제의 끝에 도달 때까지 반대 preg_match_all ()는 계속됩니다.오류가 발생한 경우 preg_match ()는 FALSE를 반환합니다.
*/
```
### 6. table prefix 수정
modules/marketplace/marketplace.admin.model.php
```
$prefix = $db_info->master_db['db_table_prefix'];
$query = $oDB->_query('SHOW COLUMNS FROM `'.$prefix.'_marketplace_items`');
```
-> 이렇게 하면 설치 자체가 안됨

### 7. 설치시 오류
```
Error #0 "Attempt to assign property "module" on null" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.class.php on line 83
``` 
> $args = new stdClass(); 추가로 해결
> 
### 8. [완료] 모듈 관리자 접근시 오류
```
Error #0 "Attempt to assign property "module_srl" on null" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.model.php on line 503 
```
$obj = new stdClass(); 추가

### 9. 모듈 접근시 오류
```
Error #0 "Attempt to assign property "cancel" on null" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.model.php on line 153 
```
> $result = new stdClass(); 추가

### 10. 
```
TypeError #0 "count(): Argument #1 ($value) must be of type Countable|array, null given" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.model.php on line 120 
```
> countobj로 수정함

### 11. 물품판매시 오류
```
TypeError #0 "implode(): Argument #2 ($array) must be of type ?array, string given" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.view.php on line 666 
```
> 이슈2번 관련해서 기본값인 경우 해당 입력필드가 3개로 나눠진게 아니라 1개의 필드값이라서...

### 12. 글등록 안됨.

### 13. 설정 > 제품분류 클릭시
```
Error #0 "Attempt to assign property "module_srl" on null" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.admin.view.php on line 171 
```
> $obj = new stdClass(); 추가
### 14. 설정 저장후 오류
```
TypeError #0 "in_array(): Argument #2 ($haystack) must be of type array, null given" in D:\Wnmp\nginx-bins\default\www\rx\files\cache\template\modules\marketplace\skins\default\_header.html.php on line 60 

```
수정전:in_array($condition->eid,Context::get('item_condition'))
수정후:in_array($condition->eid, Context::get('item_condition') ?: [])
### 15. 
```
Error #0 "Attempt to assign property "page" on null" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.view.php on line 851 
```
> $args = new stdClass(); 추가

### 16. 진행중인프리미엄광고 클릭시
```
Error #0 "Attempt to assign property "module_srl" on null" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.view.php on line 967 
```
> $args = new stdClass(); 추가
### 17. 키워드 등록시 오류
```
Error #0 "Attempt to assign property "module_srl" on null" in D:\Wnmp\nginx-bins\default\www\rx\modules\marketplace\marketplace.view.php on line 1051 
```

### 18. 키워드등록시 알림메세지 주석처리함
modules/marketplace/marketplace.controller.php:1000
```
//    $this->setMessage($msg_code);
```
### 19. 키워드 삭제시 알림메세지 주석처리함
modules/marketplace/marketplace.controller.php:1037
```
// $this->setMessage('success_deleted');
```
### 20 . 이온디 스킨 오류
```
TypeError #0 "in_array(): Argument #2 ($haystack) must be of type array, null given" in D:\Wnmp\nginx-bins\default\www\rx\files\cache\template\modules\marketplace\skins\emmpFlea\_header.html.php on line 107 
```

### 21. 대표 사진 값은 필수입니다. 계속 그대로임..
```
marketplace/ruleset/insertItem.xml 파일에서
<field name="thumbnail[0]" required="true">
required="true"를 제거해보세요.
```
참조:https://eond.com/qna/440485
> 변경 후 실제 글읽기 화면에서도 이미지가 출력되어야함에도 출력되지 않음. 
> 글 등록이 안됨..


### [완료] 230705
```Error #0 "Attempt to assign property "document_sr|" on null" in modules/marketplace/marketplace.controller.php on line 1048```
> $args = new stdClass(); 추가

### [미해결] 230705, 글읽기 글번호 안됨..

### [해결] 로그인시
```
[05-Jul-2023 23:55:04 Etc/GMT-9] PHP Exception: TypeError #0 "Unsupported operand types: int + string" in modules/marketplace/marketplace.view.php on line 641
```

### [해결]
```
[06-Jul-2023 00:00:28 Etc/GMT-9] PHP Exception: TypeError #0 "implode(): Argument #1 ($pieces) must be of type array, string given" in modules/marketplace/marketplace.view.php on line 666
```
> $contact_number = $member_info->phone_number; 로 수정함.

라이믹스는 이온디와 함께

닫기

마이페이지

로그인을 해주세요